mitchtabian / appbarlayouts Goto Github PK
View Code? Open in Web Editor NEWHow to add an App Bar on the bottom and top of your Android app
How to add an App Bar on the bottom and top of your Android app
`
public static ChooseLaptopRepair chooselaptoprepair;
Button button;
RadioGroup radioGroup;
RadioButton radioButton1,radioButton2,radioButton3;
EditText issue;
Context context;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.choose_laptop_repair);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
radioGroup = (RadioGroup) findViewById(R.id.lapcondition);
radioButton1 = (RadioButton) findViewById(R.id.laptopbattery);
radioButton2 = (RadioButton) findViewById(R.id.laptopdisplay);
radioButton3 = (RadioButton) findViewById(R.id.laptopOS);
issue = (EditText) findViewById(R.id.laptopIssue);
button= (Button) findViewById(R.id.laprepair);
button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent= new Intent(ChooseLaptopRepair.this,BranchActivityLaptopRepair.class);
startActivity(intent);
finish();
}
});
//error here
saveRadioButton();
}
//error here
public void saveRadioButton() {
SharedPreferences sharedPreferences = context.getSharedPreferences("chooselaptoprepair",MODE_PRIVATE);
SharedPreferences.Editor shEditor = sharedPreferences.edit();
shEditor.putBoolean("LapRepairButton1", radioButton1.isChecked()).apply();
shEditor.putBoolean("LapRepairButton1", radioButton2.isChecked()).apply();
shEditor.putBoolean("LapRepairButton1", radioButton3.isChecked()).apply();
shEditor.commit();
}`
I was tested your code in android 4.4.2.
How can I fix this problem that can't see text in card.
`import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.RadioButton;
import android.widget.RadioGroup;
public class ChooseLaptopRepair extends AppCompatActivity {
Button button;
RadioGroup radioGroup;
RadioButton radioButton1,radioButton2,radioButton3;
EditText issue;
Context context;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.choose_laptop_repair);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
radioGroup = (RadioGroup) findViewById(R.id.lapcondition);
radioButton1 = (RadioButton) findViewById(R.id.laptopbattery);
radioButton2 = (RadioButton) findViewById(R.id.laptopdisplay);
radioButton3 = (RadioButton) findViewById(R.id.laptopOS);
issue = (EditText) findViewById(R.id.laptopIssue);
button= (Button) findViewById(R.id.laprepair);
//shared preference //Get error here
SharedPreferences sharedPreferences = context.getSharedPreferences("chooselaptoprepair",Context.MODE_PRIVATE);
SharedPreferences.Editor shEditor = sharedPreferences.edit();
shEditor.putBoolean("LapRepairButton1", radioButton1.isChecked()).apply();
shEditor.putBoolean("LapRepairButton2", radioButton2.isChecked()).apply();
shEditor.putBoolean("LapRepairButton3", radioButton3.isChecked()).apply();
shEditor.putString("LapRepairIssue",issue.getText().toString());
shEditor.commit();
button.setOnClickListener(new View.OnClickListener()
{
@Override
public void onClick(View v) {
Intent intent= new Intent(ChooseLaptopRepair.this,BranchActivityLaptopRepair.class);
startActivity(intent);
}
});
}
}`
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.