android重启应用
生活随笔
收集整理的這篇文章主要介紹了
android重启应用
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
public static void restart(Context context)
{
System.exit(0);?
Intent intent = new Intent(context, context.getClass());?
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_NEW_TASK);?
context.startActivity(intent);
} 《新程序員》:云原生和全面數字化實踐50位技術專家共同創作,文字、視頻、音頻交互閱讀
{
System.exit(0);?
Intent intent = new Intent(context, context.getClass());?
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_NEW_TASK);?
context.startActivity(intent);
} 《新程序員》:云原生和全面數字化實踐50位技術專家共同創作,文字、視頻、音頻交互閱讀
總結
以上是生活随笔為你收集整理的android重启应用的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Installation error:
- 下一篇: 安智armeabi 和 armeabi-