10-28 16:30:54.640: DEBUG/NetworkLocationProvider(76): getLocation(): triggering a wifi scan
10-28 16:30:55.410: DEBUG/NetworkLocationProvider(76): updateWifIScanResults(): 5 APs
10-28 16:30:55.430: DEBUG/LocationMasfClient(76): getNetworkLocation(): Returning cache location with accuracy 75.0
10-28 16:31:05.220: DEBUG/dalvikvm(15032): GC freed 15 objects / 600 bytes in 124ms
10-28 16:31:05.690: INFO/ActivityManager(76): Stopping service: com.google.android.apps.maps/com.google.googlenav.friend.android.LocationFriendService
10-28 16:31:09.960: DEBUG/WifiService(76): ACTION_BATTERY_CHANGED pluggedType: 2
10-28 16:31:13.186: DEBUG/KeyguardViewMediator(76): wakeWhenReadyLocked(82)
10-28 16:31:13.190: DEBUG/KeyguardViewMediator(76): handleWakeWhenReady(82)
10-28 16:31:13.190: DEBUG/KeyguardViewMediator(76): pokeWakelock(5000)
10-28 16:31:13.250: DEBUG/WifiService(76): ACTION_SCREEN_ON
10-28 16:31:13.430: DEBUG/SurfaceFlinger(76): Screen about to return, flinger = 0x1896a0
10-28 16:31:15.610: DEBUG/KeyguardViewMediator(76): pokeWakelock(5000)
答案 0 :(得分:0)
如果您长时间阻止GUI线程(如果您没有手动创建其他线程),则会显示此消息。如果您的活动中有一些代码需要大量工作或长时间休眠,则应将此代码移至另一个帖子。
我建议您测量所有活动方法所花费的时间。
答案 1 :(得分:0)
如果你弄清楚你在做什么繁重的工作,你可以将它拆分成另一个线程,然后在完成后回调到UI线程,这样你就可以激活你的Intent。
public class ExampleActivity extends Activity
private ProgressDialog mDialog;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mDialog= ProgressDialog.show(ExampleActivity.this, "Please wait...", "...", true);
new Thread(new Runnable() {
@Override
public void run() {
// Do some long loading
// and then
mHandler.sendEmptyMessage(1); //Notice the 1 in the switch statement
}
}).start();
}
public Handler mHandler = new Handler() {
public void handleMessage(Message msg) {
switch (msg.what) {
case 1:
mDialog.dismiss();
// Your back in the UI thread
// Fire whatever method you want
break;
default:
Log.i(TAG, "Handler on got message that wasnt dealt with");
break;
}
}
};
}
一方面,我不能看到你正在进行iPhone转换,删除后退按钮...在UI上不需要也不愉快
答案 2 :(得分:0)
我希望您了解阻止GUI线程的含义。 如果你愿意的话,你也可以尝试在处理程序内部进行大量的时间操作,例如网络活动。