Added importing provider profiles

This commit is contained in:
M66B
2022-03-22 10:45:02 +01:00
parent 443a5b12e7
commit e8b391a862
6 changed files with 150 additions and 31 deletions

View File

@@ -19,6 +19,7 @@ package eu.faircode.email;
Copyright 2018-2022 by Marcel Bokhorst (M66B)
*/
import android.app.Activity;
import android.app.ActivityManager;
import android.app.NotificationChannel;
import android.app.NotificationManager;
@@ -172,6 +173,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
private SwitchCompat swInfra;
private SwitchCompat swDupMsgId;
private SwitchCompat swTestIab;
private Button btnImportProviders;
private TextView tvProcessors;
private TextView tvMemoryClass;
private TextView tvMemoryUsage;
@@ -333,6 +335,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
swInfra = view.findViewById(R.id.swInfra);
swDupMsgId = view.findViewById(R.id.swDupMsgId);
swTestIab = view.findViewById(R.id.swTestIab);
btnImportProviders = view.findViewById(R.id.btnImportProviders);
tvProcessors = view.findViewById(R.id.tvProcessors);
tvMemoryClass = view.findViewById(R.id.tvMemoryClass);
tvMemoryUsage = view.findViewById(R.id.tvMemoryUsage);
@@ -1144,6 +1147,17 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
}
});
btnImportProviders.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(Intent.ACTION_GET_CONTENT);
intent.addCategory(Intent.CATEGORY_OPENABLE);
intent.setType("*/*");
Intent choose = Helper.getChooser(v.getContext(), intent);
getActivity().startActivityForResult(choose, ActivitySetup.REQUEST_IMPORT_PROVIDERS);
}
});
btnGC.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {