編輯:關於Android編程
錯誤日志
android.view.WindowManager$BadTokenException: Unable to add window -- token android.os.BinderProxy@427b7270 is not valid; is your activity running? at android.view.ViewRootImpl.setView(ViewRootImpl.java:653) at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:326) at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:224) at android.view.WindowManagerImpl$CompatModeWrapper.addView(WindowManagerImpl.java:149) at android.view.Window$LocalWindowManager.addView(Window.java:558) at android.app.Dialog.show(Dialog.java:316)錯誤原因
java.lang.IllegalArgumentException: View not attached to window manager at android.view.WindowManagerGlobal.findViewLocked(WindowManagerGlobal.java:383) at android.view.WindowManagerGlobal.removeView(WindowManagerGlobal.java:285) at android.view.WindowManagerImpl.removeView(WindowManagerImpl.java:104) at android.app.Dialog.dismissDialog(Dialog.java:332) at android.app.Dialog.dismiss(Dialog.java:315)
@Override public void onDestroy() { super.onDestroy(); dialog=null; }
java.lang.SecurityException: Permission Denial: reading com.android.providers.contacts.ContactsProvider2 uri content://com.android.contacts/data/phones from pid=27697, uid=10194 requires android.permission.READ_CONTACTS, or grantUriPermission() at android.os.Parcel.readException(Parcel.java:1465) at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:185) at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:137) at android.content.ContentProviderProxy.query(ContentProviderNative.java:413) at android.content.ContentResolver.query(ContentResolver.java:470) at android.content.ContentResolver.query(ContentResolver.java:413)
android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.DIAL dat=tel:xxxxxxxxxxxx } at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1632) at android.app.Instrumentation.execStartActivity(Instrumentation.java:1424) at android.app.Activity.startActivityForResult(Activity.java:3438) at android.app.Activity.startActivityForResult(Activity.java:3399)
android.view.ViewRootImpl$CalledFromWrongThreadException: Only the original thread that created a view hierarchy can touch its views. at android.view.ViewRootImpl.checkThread(ViewRootImpl.java:5281) at android.view.ViewRootImpl.requestLayout(ViewRootImpl.java:943) at android.view.View.requestLayout(View.java:15614) at android.view.View.requestLayout(View.java:15614)
Looper.prepare(); Toast.makeText(aActivity.this,"test",Toast.LENGTH_SHORT).show(); Looper.loop();
private final Handler msgHandler = new Handler(){ public void handleMessage(Message msg) { switch (msg.arg1) { case R.string.msg_not_network: Toast.makeText(getApplicationContext(), getResources().getString(R.string.msg_not_network), Toast.LENGTH_SHORT).show(); break; default: break; } } };
Message msg = msgHandler.obtainMessage(); msg.arg1 = R.string.msg_not_network; msgHandler.sendMessage(msg);
小米手環APP更新之後出現了一個新功能,就是小米手環的接入微信得位置發生了變化,下面下載吧小編就為大家介紹一下小米手環如何接入微信,隨時查看自己今日活動是否
一、概述EventBus是一款針對Android優化的發布/訂閱事件總線。主要功能是替代Intent,Handler,BroadCast在Fragment,Activit
這篇文章就是示范如何用GSON把JSON數據與實體類進行相互轉化,需要用到gson-2.3.1.jar這個包。直接貼代碼了:import java.lang.reflec
前言在Android View 事件分發機制源碼詳解(ViewGroup篇)一文中,主要對ViewGroup#dispatchTouchEvent的源碼做了相應的解析,其