当前位置: 首页>>代码示例>>Java>>正文


Java Intent.ACTION_UNINSTALL_PACKAGE属性代码示例

本文整理汇总了Java中android.content.Intent.ACTION_UNINSTALL_PACKAGE属性的典型用法代码示例。如果您正苦于以下问题:Java Intent.ACTION_UNINSTALL_PACKAGE属性的具体用法?Java Intent.ACTION_UNINSTALL_PACKAGE怎么用?Java Intent.ACTION_UNINSTALL_PACKAGE使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在android.content.Intent的用法示例。


在下文中一共展示了Intent.ACTION_UNINSTALL_PACKAGE属性的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: launchUninstallIntent

private void launchUninstallIntent(String packageName) {
    if (mChildLock) return;

    Log.d(TAG, "Uninstalling " + packageName);
    Uri packageUri = Uri.parse("package:" + packageName);
    Intent uninstallIntent = new Intent(Intent.ACTION_UNINSTALL_PACKAGE, packageUri);
    uninstallIntent.putExtra(Intent.EXTRA_RETURN_RESULT, true);
    startActivityForResult(uninstallIntent, UNINSTALL_RESULT);
}
 
开发者ID:quaap,项目名称:LaunchTime,代码行数:9,代码来源:MainActivity.java

示例2: _uninstall

private void _uninstall(String packageId, CallbackContext callbackContext) throws JSONException {
	if (this._appIsInstalled(packageId)) {
		Intent intent = new Intent(Intent.ACTION_UNINSTALL_PACKAGE);
		intent.setData(Uri.parse("package:" + packageId));
		cordova.getActivity().startActivity(intent);
		callbackContext.success();
	}
	else {
		JSONObject errorObj = new JSONObject();
		errorObj.put("status", PluginResult.Status.ERROR.ordinal());
		errorObj.put("message", "This package is not installed");
		callbackContext.error(errorObj);
	}
}
 
开发者ID:Edc-zhang,项目名称:cordova-plugin-file-opener2-android7.0,代码行数:14,代码来源:FileOpener2.java

示例3: uninstallPackage

public Intent uninstallPackage(final String packageName) {
  Uri packageUri = Uri.parse(String.format("package:%s", packageName));

  Intent intent = new Intent(Intent.ACTION_UNINSTALL_PACKAGE);
  intent.setData(packageUri);
  intent.putExtra(Intent.EXTRA_RETURN_RESULT, true);
  return intent;
}
 
开发者ID:philipphager,项目名称:disclosure-android-app,代码行数:8,代码来源:IntentFactory.java

示例4: onButtonClickListener

@Override
public void onButtonClickListener(AppInfo app, View v) {

    int id = v.getId();
    switch (id) {
        case R.id.uninstallApk: {
            Toast.makeText(this, "uninstall", Toast.LENGTH_SHORT).show();
            Intent intent = new Intent(Intent.ACTION_UNINSTALL_PACKAGE);
            intent.setData(Uri.parse("package:" + app.getPacName()));
            intent.putExtra(Intent.EXTRA_RETURN_RESULT, true);
            startActivityForResult(intent, UNINSTALL_REQUEST_CODE);
            break;
        }
        case R.id.extractApk: {
            Toast.makeText(this, "extract", Toast.LENGTH_SHORT).show();
            new ExtractFileInBackground(SelectedApplication.this, app).execute();
            break;
        }
        case R.id.shareApk: {
            Toast.makeText(this, "share", Toast.LENGTH_SHORT).show();
            UtilsApp.copyFile(app);
            Intent shareIntent = UtilsApp.getShareIntent(UtilsApp.getOutputFilename(app));
            startActivity(Intent.createChooser(shareIntent, String.format(getResources().getString(R.string.send_to), app.getAppName())));
            break;
        }
    }

}
 
开发者ID:HitRoxxx,项目名称:FloatingNew,代码行数:28,代码来源:SelectedApplication.java


注:本文中的android.content.Intent.ACTION_UNINSTALL_PACKAGE属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。