Launch FeedbackActivity in my application like in Android Hangouts

后端 未结 3 1447
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-02-15 00:19

I would like to launch com.google.android.feedback.FeedbackActivity for my application. Like it happens in Hangouts application.

Does anyone knows which ex

3条回答
  •  悲哀的现实
    2021-02-15 01:25

    So it seems that this is possible, bur report is not visible in Developer console.

    @TargetApi(Build.VERSION_CODES.ICE_CREAM_SANDWICH)
    protected Intent prepareIcsFeedbackIntent(Activity activity, PackageManager packageManager) {
        ApplicationErrorReport localApplicationErrorReport = new ApplicationErrorReport();
        localApplicationErrorReport.packageName = activity.getPackageName();
    
        localApplicationErrorReport.type = 11;
        localApplicationErrorReport.installerPackageName = packageManager.getInstallerPackageName(
                localApplicationErrorReport.packageName);
    
        return getAppErrortIntent().putExtra(Intent.EXTRA_BUG_REPORT, localApplicationErrorReport);
    }
    
    @TargetApi(Build.VERSION_CODES.ICE_CREAM_SANDWICH)
    protected Intent getAppErrortIntent() {
        Intent localIntent = new Intent(Intent.ACTION_APP_ERROR)
                .addCategory(Intent.CATEGORY_DEFAULT)
                .addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
        return localIntent;
    }
    

提交回复
热议问题