public static void main(String args[]) {
// 具体使用方法
// OpenUrl ou = new OpenUrl();
// System.out.println(ou.getContent("http://122.72.17.25/icache/www.beiaoo.cn/woyiwei.mp3"));
HttpClient httpclient = new DefaultHttpClient(); HttpUriRequest httpUriRequest = null;
httpUriRequest = new HttpGet("http://122.72.17.25/icache/www.beiaoo.cn/woyiwei.mp3");
try {
HttpResponse httpResponse = httpclient.execute(httpUriRequest);
HttpEntity entity = httpResponse.getEntity();
if (entity != null) {
System.out.println("链接可用");
}else{
System.out.println("链接为死链");
}
} catch (ClientProtocolException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}Exception in thread "main" java.lang.RuntimeException: Stub!
at org.apache.http.impl.client.AbstractHttpClient.<init>(AbstractHttpClient.java:5)
at org.apache.http.impl.client.DefaultHttpClient.<init>(DefaultHttpClient.java:7)
at OpenUrl.main(OpenUrl.java:74)
第74行即红色标注的那一行,不知哪位知道为什么出错,请不吝赐教,谢谢!
// 具体使用方法
// OpenUrl ou = new OpenUrl();
// System.out.println(ou.getContent("http://122.72.17.25/icache/www.beiaoo.cn/woyiwei.mp3"));
HttpClient httpclient = new DefaultHttpClient(); HttpUriRequest httpUriRequest = null;
httpUriRequest = new HttpGet("http://122.72.17.25/icache/www.beiaoo.cn/woyiwei.mp3");
try {
HttpResponse httpResponse = httpclient.execute(httpUriRequest);
HttpEntity entity = httpResponse.getEntity();
if (entity != null) {
System.out.println("链接可用");
}else{
System.out.println("链接为死链");
}
} catch (ClientProtocolException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}Exception in thread "main" java.lang.RuntimeException: Stub!
at org.apache.http.impl.client.AbstractHttpClient.<init>(AbstractHttpClient.java:5)
at org.apache.http.impl.client.DefaultHttpClient.<init>(DefaultHttpClient.java:7)
at OpenUrl.main(OpenUrl.java:74)
第74行即红色标注的那一行,不知哪位知道为什么出错,请不吝赐教,谢谢!
public void onClick(DialogInterface dialog, int which) {
// ActivityManager am = (ActivityManager)getSystemService(Context.ACTIVITY_SERVICE);
// am.restartPackage(getPackageName());
// }
requestWindowFeature(Window.FEATURE_NO_TITLE); //设置activity 显示没有标题
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,//全屏显示
WindowManager.LayoutParams.FLAG_FULLSCREEN);
width = this.getWindowManager().getDefaultDisplay().getWidth(); //得到宽高
height = this.getWindowManager().getDefaultDisplay().getHeight();
隐藏状态栏代码: getWindow().setFlags(WindowManager.LayoutParams.TYPE_STATUS_BAR, WindowManager.LayoutParams.TYPE_STATUS_BAR);requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);