我想在用户按下主页按钮后重新启动活动时专门调用一个方法。
我试过了,但它不工作
@Override
public void onRestart() {
super.onRestart();
// Do Here what ever you want do on back press;
Log.d(TAG,"restart");
blnIsApp=true;
}
@Override
public void onResume() {
// Do Here what ever you want do on back press;
super.onResume();
if(blnIsApp==false)
{
Log.d(TAG,"external");
}else{
Log.d(TAG,"internal");
}
blnIsApp=false;
}