Inflate without attaching to root

This commit is contained in:
M66B 2016-02-13 15:55:22 +01:00
parent 02f8abaf1c
commit 6d4639325d
4 changed files with 7 additions and 7 deletions

View File

@ -91,7 +91,7 @@ public class ActivityLog extends AppCompatActivity implements SharedPreferences.
running = true;
// Action bar
View actionView = getLayoutInflater().inflate(R.layout.action, null);
View actionView = getLayoutInflater().inflate(R.layout.action, null, false);
SwitchCompat swEnabled = (SwitchCompat) actionView.findViewById(R.id.swEnabled);
getSupportActionBar().setDisplayShowCustomEnabled(true);

View File

@ -113,7 +113,7 @@ public class ActivityMain extends AppCompatActivity implements SharedPreferences
}
// Action bar
View actionView = getLayoutInflater().inflate(R.layout.action, null);
View actionView = getLayoutInflater().inflate(R.layout.action, null, false);
SwitchCompat swEnabled = (SwitchCompat) actionView.findViewById(R.id.swEnabled);
getSupportActionBar().setDisplayShowCustomEnabled(true);
@ -135,7 +135,7 @@ public class ActivityMain extends AppCompatActivity implements SharedPreferences
} else {
// Show dialog
LayoutInflater inflater = LayoutInflater.from(ActivityMain.this);
View view = inflater.inflate(R.layout.vpn, null);
View view = inflater.inflate(R.layout.vpn, null, false);
dialogVpn = new AlertDialog.Builder(ActivityMain.this)
.setView(view)
.setCancelable(false)
@ -219,7 +219,7 @@ public class ActivityMain extends AppCompatActivity implements SharedPreferences
if (!initialized) {
// Create view
LayoutInflater inflater = LayoutInflater.from(this);
View view = inflater.inflate(R.layout.first, null);
View view = inflater.inflate(R.layout.first, null, false);
TextView tvFirst = (TextView) view.findViewById(R.id.tvFirst);
tvFirst.setMovementMethod(LinkMovementMethod.getInstance());
@ -655,7 +655,7 @@ public class ActivityMain extends AppCompatActivity implements SharedPreferences
private void menu_about() {
// Create view
LayoutInflater inflater = LayoutInflater.from(this);
View view = inflater.inflate(R.layout.about, null);
View view = inflater.inflate(R.layout.about, null, false);
TextView tvVersion = (TextView) view.findViewById(R.id.tvVersion);
Button btnRate = (Button) view.findViewById(R.id.btnRate);
TextView tvLicense = (TextView) view.findViewById(R.id.tvLicense);

View File

@ -515,7 +515,7 @@ public class ActivitySettings extends AppCompatActivity implements SharedPrefere
// Show dialog
if (prefs.getBoolean(name, false)) {
LayoutInflater inflater = LayoutInflater.from(ActivitySettings.this);
View view = inflater.inflate(R.layout.filter, null);
View view = inflater.inflate(R.layout.filter, null, false);
dialogFilter = new AlertDialog.Builder(ActivitySettings.this)
.setView(view)
.setCancelable(false)

View File

@ -442,7 +442,7 @@ public class Util {
public static void areYouSure(Context context, int explanation, final DoubtListener listener) {
LayoutInflater inflater = LayoutInflater.from(context);
View view = inflater.inflate(R.layout.sure, null);
View view = inflater.inflate(R.layout.sure, null, false);
TextView tvExplanation = (TextView) view.findViewById(R.id.tvExplanation);
tvExplanation.setText(explanation);
new AlertDialog.Builder(context)