mirror of
https://github.com/emanuele-f/PCAPdroid.git
synced 2026-06-16 21:10:57 +08:00
Changed Help popup to use AlertDialog instead of Toaster.
This commit is contained in:
parent
cff85f84ea
commit
14424a84ae
@ -391,6 +391,19 @@ public class Utils {
|
||||
Toast.makeText(context, msg, Toast.LENGTH_LONG).show();
|
||||
}
|
||||
|
||||
public static void showHelpDialog(Context context, int id){
|
||||
String msg = context.getResources().getString(id);
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(context);
|
||||
builder.setTitle(R.string.hint);
|
||||
builder.setMessage(msg);
|
||||
builder.setCancelable(true);
|
||||
builder.setNeutralButton(R.string.ok,
|
||||
(dialog, id1) -> dialog.cancel());
|
||||
|
||||
AlertDialog alert= builder.create();
|
||||
alert.show();
|
||||
}
|
||||
|
||||
public static Dialog getAppSelectionDialog(Activity activity, List<AppDescriptor> appsData, AppsListView.OnSelectedAppListener listener) {
|
||||
View dialogLayout = activity.getLayoutInflater().inflate(R.layout.apps_selector, null);
|
||||
SearchView searchView = dialogLayout.findViewById(R.id.apps_search);
|
||||
|
||||
@ -94,7 +94,7 @@ public class EditListActivity extends BaseActivity {
|
||||
|
||||
return true;
|
||||
} else if(id == R.id.show_help) {
|
||||
Utils.showToastLong(this, mListInfo.getHelpString());
|
||||
Utils.showHelpDialog(this, mListInfo.getHelpString());
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@ -190,5 +190,6 @@
|
||||
<string name="malware_detection_ad0">Ready to enhance the security of your device?</string>
|
||||
<string name="malware_detection_ad1">Meet the PCAPdroid malware detection!</string>
|
||||
<string name="show_me">Show me</string>
|
||||
<string name="hint">Hint</string>
|
||||
</resources>
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user