Ajout page parametre
This commit is contained in:
@@ -34,13 +34,13 @@ public class MainActivity extends Activity {
|
||||
startActivity(tp2Intent);
|
||||
}
|
||||
});*/
|
||||
/*mSettings.setOnClickListener(new View.OnClickListener() {
|
||||
mSettings.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
Intent tp3Intent = new Intent(MainActivity.this, Settings.class);
|
||||
Intent tp3Intent = new Intent(MainActivity.this, SettingsActivity.class);
|
||||
startActivity(tp3Intent);
|
||||
}
|
||||
});*/
|
||||
});
|
||||
/*mTP4.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
|
@@ -0,0 +1,33 @@
|
||||
package com.example.mastermind;
|
||||
|
||||
import android.os.Bundle;
|
||||
|
||||
import androidx.appcompat.app.ActionBar;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.preference.PreferenceFragmentCompat;
|
||||
|
||||
public class SettingsActivity extends AppCompatActivity {
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.settings_activity);
|
||||
if (savedInstanceState == null) {
|
||||
getSupportFragmentManager()
|
||||
.beginTransaction()
|
||||
.replace(R.id.settings, new SettingsFragment())
|
||||
.commit();
|
||||
}
|
||||
ActionBar actionBar = getSupportActionBar();
|
||||
if (actionBar != null) {
|
||||
actionBar.setDisplayHomeAsUpEnabled(true);
|
||||
}
|
||||
}
|
||||
|
||||
public static class SettingsFragment extends PreferenceFragmentCompat {
|
||||
@Override
|
||||
public void onCreatePreferences(Bundle savedInstanceState, String rootKey) {
|
||||
setPreferencesFromResource(R.xml.root_preferences, rootKey);
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user