Fixed configActivity startActivity fail on Android 6.x

This commit is contained in:
PeratX 2017-05-17 22:28:32 +08:00
parent a792265b7d
commit 7db744aa75
3 changed files with 16 additions and 4 deletions

View File

@ -75,7 +75,8 @@ public class DnsServersFragment extends Fragment {
public void onClick(View v) {
startActivity(new Intent(getActivity(), ConfigActivity.class)
.putExtra(ConfigActivity.LAUNCH_ACTION_ID, ConfigActivity.ID_NONE)
.putExtra(ConfigActivity.LAUNCH_ACTION_FRAGMENT, ConfigActivity.LAUNCH_FRAGMENT_DNS_SERVER));
.putExtra(ConfigActivity.LAUNCH_ACTION_FRAGMENT, ConfigActivity.LAUNCH_FRAGMENT_DNS_SERVER)
.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK));
}
});
return view;
@ -156,7 +157,9 @@ public class DnsServersFragment extends Fragment {
public void onClick(View v) {
if (!DnsServerHelper.isInUsing(Daedalus.configurations.getCustomDnsServers().get(index))) {
Daedalus.getInstance().startActivity(new Intent(Daedalus.getInstance(), ConfigActivity.class)
.putExtra(ConfigActivity.LAUNCH_ACTION_ID, index));
.putExtra(ConfigActivity.LAUNCH_ACTION_ID, index)
.putExtra(ConfigActivity.LAUNCH_ACTION_FRAGMENT, ConfigActivity.LAUNCH_FRAGMENT_DNS_SERVER)
.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK));
}
}
}

View File

@ -80,7 +80,8 @@ public class RulesFragment extends Fragment {
public void onClick(View v) {
startActivity(new Intent(getActivity(), ConfigActivity.class)
.putExtra(ConfigActivity.LAUNCH_ACTION_ID, ConfigActivity.ID_NONE)
.putExtra(ConfigActivity.LAUNCH_ACTION_FRAGMENT, ConfigActivity.LAUNCH_FRAGMENT_RULE));
.putExtra(ConfigActivity.LAUNCH_ACTION_FRAGMENT, ConfigActivity.LAUNCH_FRAGMENT_RULE)
.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK));
}
});
return view;
@ -184,7 +185,8 @@ public class RulesFragment extends Fragment {
if (!Daedalus.configurations.getRules().get(index).isUsing()) {
Daedalus.getInstance().startActivity(new Intent(Daedalus.getInstance(), ConfigActivity.class)
.putExtra(ConfigActivity.LAUNCH_ACTION_ID, index)
.putExtra(ConfigActivity.LAUNCH_ACTION_FRAGMENT, ConfigActivity.LAUNCH_FRAGMENT_RULE));
.putExtra(ConfigActivity.LAUNCH_ACTION_FRAGMENT, ConfigActivity.LAUNCH_FRAGMENT_RULE)
.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK));
}
return true;
}

View File

@ -0,0 +1,7 @@
package org.itxtech.daedalus.fragment;
/**
* @author PeratX
*/
public class RulesFragment1 {
}