Simplification

pull/146/head
M66B 6 years ago
parent ed513ddb68
commit 9c1c2f8e32

@ -19,6 +19,7 @@ package eu.faircode.email;
Copyright 2018 by Marcel Bokhorst (M66B) Copyright 2018 by Marcel Bokhorst (M66B)
*/ */
import android.content.Intent;
import android.content.SharedPreferences; import android.content.SharedPreferences;
import android.content.res.Configuration; import android.content.res.Configuration;
import android.os.Bundle; import android.os.Bundle;
@ -28,6 +29,7 @@ import android.util.Log;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity; import androidx.appcompat.app.AppCompatActivity;
abstract class ActivityBase extends AppCompatActivity implements SharedPreferences.OnSharedPreferenceChangeListener { abstract class ActivityBase extends AppCompatActivity implements SharedPreferences.OnSharedPreferenceChangeListener {
@ -74,6 +76,14 @@ abstract class ActivityBase extends AppCompatActivity implements SharedPreferenc
super.onDestroy(); super.onDestroy();
} }
@Override
protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
Log.i(Helper.TAG, "Result class=" + this.getClass().getSimpleName() +
" request=" + requestCode + " result=" + resultCode + " data=" + data);
super.onActivityResult(requestCode, resultCode, data);
}
@Override @Override
public void onSharedPreferenceChanged(SharedPreferences prefs, String key) { public void onSharedPreferenceChanged(SharedPreferences prefs, String key) {
Log.i(Helper.TAG, "Preference " + key + "=" + prefs.getAll().get(key)); Log.i(Helper.TAG, "Preference " + key + "=" + prefs.getAll().get(key));

@ -1315,7 +1315,6 @@ public class ActivityView extends ActivityBilling implements FragmentManager.OnB
@Override @Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) { protected void onActivityResult(int requestCode, int resultCode, Intent data) {
Log.i(Helper.TAG, "View onActivityResult request=" + requestCode + " result=" + resultCode + " data=" + data);
if (resultCode == Activity.RESULT_OK) if (resultCode == Activity.RESULT_OK)
if (requestCode == REQUEST_ATTACHMENT) { if (requestCode == REQUEST_ATTACHMENT) {
if (data != null) { if (data != null) {

@ -1025,8 +1025,6 @@ public class FragmentAccount extends FragmentEx {
@Override @Override
public void onActivityResult(int requestCode, int resultCode, Intent data) { public void onActivityResult(int requestCode, int resultCode, Intent data) {
Log.i(Helper.TAG, "Activity result request=" + requestCode + " result=" + resultCode + " data=" + data);
if (resultCode == Activity.RESULT_OK) if (resultCode == Activity.RESULT_OK)
if (requestCode == ActivitySetup.REQUEST_CHOOSE_ACCOUNT) { if (requestCode == ActivitySetup.REQUEST_CHOOSE_ACCOUNT) {
String name = data.getStringExtra(AccountManager.KEY_ACCOUNT_NAME); String name = data.getStringExtra(AccountManager.KEY_ACCOUNT_NAME);

@ -777,7 +777,6 @@ public class FragmentCompose extends FragmentEx {
@Override @Override
public void onActivityResult(int requestCode, int resultCode, Intent data) { public void onActivityResult(int requestCode, int resultCode, Intent data) {
Log.i(Helper.TAG, "Compose onActivityResult request=" + requestCode + " result=" + resultCode + " data=" + data);
if (resultCode == RESULT_OK) { if (resultCode == RESULT_OK) {
if (requestCode == ActivityCompose.REQUEST_IMAGE) { if (requestCode == ActivityCompose.REQUEST_IMAGE) {
if (data != null) if (data != null)

@ -439,8 +439,6 @@ public class FragmentSetup extends FragmentEx {
@Override @Override
public void onActivityResult(final int requestCode, int resultCode, final Intent data) { public void onActivityResult(final int requestCode, int resultCode, final Intent data) {
Log.i(Helper.TAG, "Request=" + requestCode + " result=" + resultCode + " data=" + data);
if (requestCode == ActivitySetup.REQUEST_EXPORT || requestCode == ActivitySetup.REQUEST_IMPORT) if (requestCode == ActivitySetup.REQUEST_EXPORT || requestCode == ActivitySetup.REQUEST_IMPORT)
if (resultCode == RESULT_OK && data != null) { if (resultCode == RESULT_OK && data != null) {
final View dview = LayoutInflater.from(getContext()).inflate(R.layout.dialog_password, null); final View dview = LayoutInflater.from(getContext()).inflate(R.layout.dialog_password, null);

Loading…
Cancel
Save