public void showSettingDialog ( Context context , final List < String > permissions ) { List < String > permissionNames = Permission . transformText ( context , permissions ) ; String message = context . getString ( R . string . message_permission_always_failed , TextUtils . join ( "\n" , permissionNames ) ) ; new AlertDialog . Builder ( context ) . setCancelable ( false ) . setTitle ( R . string . title_dialog ) . setMessage ( message ) . setPositiveButton ( R . string . setting , new DialogInterface . OnClickListener ( ) { @ Override public void onClick ( DialogInterface dialog , int which ) { setPermission ( ) ; } } ) . setNegativeButton ( R . string . cancel , new DialogInterface . OnClickListener ( ) { @ Override public void onClick ( DialogInterface dialog , int which ) { } } ) . show ( ) ; }
Display setting dialog .