[英]how to close/finish System AppInfo Screen from my app
how to close/finish System AppInfo Screen from my application. 如何从我的应用程序关闭/完成系统AppInfo屏幕。 actually System AppInfo Screen open directly from my application by below code
实际上,通过以下代码从我的应用程序直接打开系统AppInfo屏幕
public static void showInstalledAppDetails(Context context, String packageName) {
Intent intent = new Intent();
final int apiLevel = Build.VERSION.SDK_INT;
if (apiLevel >= 9) { // above 2.3
intent.setAction(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
intent.putExtra("frommyapp", true);
Uri uri = Uri.fromParts(SCHEME, packageName, null);
intent.setData(uri);
} else { // below 2.3
final String appPkgName = (apiLevel == 8 ? APP_PKG_NAME_22
: APP_PKG_NAME_21);
intent.setAction(Intent.ACTION_VIEW);
intent.putExtra("frommyapp", true);
intent.setClassName(APP_DETAILS_PACKAGE_NAME,
APP_DETAILS_CLASS_NAME);
intent.putExtra(appPkgName, packageName);
}
intent.putExtra("extraData", "somedata");
context.startActivity(intent);
}
after open system appinfo screen then i want to close/finish system appinfo screen when click "Force Stop" button without back button press 打开系统appinfo屏幕后,然后我想在不单击后退按钮的情况下单击“强制停止”按钮来关闭/完成系统appinfo屏幕
so please help me to solve this type of issues. 因此,请帮助我解决此类问题。
I solved this issue myself.. 我自己解决了这个问题。
use `finishActivity(requestcode); 使用`finishActivity(requestcode);
when you start activity by 当您开始活动时
startActivityForResult(intent,requestcode);
use this requestcode at the time of finishactivity by 在完成活动时使用此请求代码,方法是
finishActivity(requestcode);
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.