startActivityForResult - WIFI 设置不返回 App
startActivityForResult - WIFI Settings Don't Go Back To App
我正在开始 Settings - Wireless
的意图,问题是每当我按 KeyBack
。它不会返回到我的应用程序,而是关闭它。
wifiManagerCheck = (WifiManager)getSystemService(Context.WIFI_SERVICE);
if (!checkWifiEnabledSwitch(wifiManagerCheck)){
//NOTIFY THROUGH SNACK BAR ACTION TO SETTINGS
Snackbar.make(findViewById(android.R.id.content),"No internet",Snackbar.LENGTH_LONG)
.setAction("Turn on", new View.OnClickListener() {
@Override
public void onClick(View v) {
startActivityForResult(new Intent(android.provider.Settings.ACTION_WIFI_SETTINGS), 0);
}
}).show();
}
这是正确的吗?我把这个放在 link:
startActivityForResult(new Intent(android.provider.Settings.ACTION_WIFI_SETTINGS), 0);
检查 activity,是否有类似 noHistory=true 的内容?
我正在开始 Settings - Wireless
的意图,问题是每当我按 KeyBack
。它不会返回到我的应用程序,而是关闭它。
wifiManagerCheck = (WifiManager)getSystemService(Context.WIFI_SERVICE);
if (!checkWifiEnabledSwitch(wifiManagerCheck)){
//NOTIFY THROUGH SNACK BAR ACTION TO SETTINGS
Snackbar.make(findViewById(android.R.id.content),"No internet",Snackbar.LENGTH_LONG)
.setAction("Turn on", new View.OnClickListener() {
@Override
public void onClick(View v) {
startActivityForResult(new Intent(android.provider.Settings.ACTION_WIFI_SETTINGS), 0);
}
}).show();
}
这是正确的吗?我把这个放在 link:
startActivityForResult(new Intent(android.provider.Settings.ACTION_WIFI_SETTINGS), 0);
检查 activity,是否有类似 noHistory=true 的内容?