This commit is contained in:
jens 2022-01-08 14:46:01 +01:00
parent 9a50da550a
commit 230521149f

View File

@ -241,18 +241,20 @@ public class ActivityManageActionStartActivity extends Activity
public void onClick(DialogInterface dialog, int which) public void onClick(DialogInterface dialog, int which)
{ {
dialog.dismiss(); dialog.dismiss();
getActionStartActivityDialog2(applicationArray[which]).show(); getActionStartActivityDialog2(applicationArray[which]);
} }
}); });
AlertDialog alertDialog = alertDialogBuilder.create(); AlertDialog alertDialog = alertDialogBuilder.create();
return alertDialog; return alertDialog;
} }
private AlertDialog getActionStartActivityDialog2(String applicationName) private void getActionStartActivityDialog2(String applicationName)
{ {
AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(this); AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(this);
alertDialogBuilder.setTitle(getResources().getString(R.string.selectPackageOfApplication)); alertDialogBuilder.setTitle(getResources().getString(R.string.selectPackageOfApplication));
final String[] packageArray = ActivityManageActionStartActivity.getPackageListString(this, applicationName); final String[] packageArray = ActivityManageActionStartActivity.getPackageListString(this, applicationName);
if(packageArray.length > 1)
{
alertDialogBuilder.setItems(packageArray, new DialogInterface.OnClickListener() alertDialogBuilder.setItems(packageArray, new DialogInterface.OnClickListener()
{ {
@Override @Override
@ -260,13 +262,18 @@ public class ActivityManageActionStartActivity extends Activity
{ {
getActionStartActivityDialog3(packageArray[which]).show(); getActionStartActivityDialog3(packageArray[which]).show();
Miscellaneous.messageBox(getResources().getString(R.string.hint), getResources().getString(R.string.chooseActivityHint), ActivityManageActionStartActivity.this).show(); Miscellaneous.messageBox(getResources().getString(R.string.hint), getResources().getString(R.string.chooseActivityHint), ActivityManageActionStartActivity.this).show();
} }
}); });
AlertDialog alertDialog = alertDialogBuilder.create(); AlertDialog alertDialog = alertDialogBuilder.create();
alertDialog.show();
return alertDialog;
} }
else
{
getActionStartActivityDialog3(packageArray[0]).show();
Miscellaneous.messageBox(getResources().getString(R.string.hint), getResources().getString(R.string.chooseActivityHint), ActivityManageActionStartActivity.this).show();
}
}
private AlertDialog getActionStartActivityDialog3(final String packageName) private AlertDialog getActionStartActivityDialog3(final String packageName)
{ {
AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(this); AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(this);
@ -598,7 +605,6 @@ public class ActivityManageActionStartActivity extends Activity
} }
}); });
AlertDialog alertDialog = alertDialogBuilder.create(); AlertDialog alertDialog = alertDialogBuilder.create();
return alertDialog; return alertDialog;
} }
@ -617,7 +623,5 @@ public class ActivityManageActionStartActivity extends Activity
progressDialog.dismiss(); progressDialog.dismiss();
getActionStartActivityDialog1().show(); getActionStartActivityDialog1().show();
} }
} }
} }