Activity中我该怎样使用Bitmap方法,或者还有更好的办法 求各位帮忙,同时标明注释 ,看看谁的方法最好public class Logining1Activity extends Activity {
/** Called when the activity is first created. */
EditText username;
EditText password;
CheckBox p1,p2,p3,p4;
Button logining;
String name;
String pasd;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
username=(EditText)findViewById(R.id.autocomplete);
password=(EditText)findViewById(R.id.password);
p1=(CheckBox)findViewById(R.id.plain_cb1);
p2=(CheckBox)findViewById(R.id.plain_cb2);
p3=(CheckBox)findViewById(R.id.plain_cb3);
p4=(CheckBox)findViewById(R.id.plain_cb4);
logining=(Button)findViewById(R.id.logining);
p1.setOnClickListener(new OnClickListener() {public void onClick(View v) {
// TODO Auto-generated method stub
name = username.getText().toString();
pasd = password.getText().toString();
SharedPreferences sp = getSharedPreferences("preferences", Context.MODE_PRIVATE);
Editor editor = sp.edit(); editor.putString("name", name); editor.putString("password", pasd);
if (editor.commit()) Toast.makeText(Logining1Activity.this, R.string.save_success, 1).show(); else
Toast.makeText(Logining1Activity.this,
R.string.save_failed, 1).show();
}
});
logining.setOnClickListener(new OnClickListener() {public void onClick(View v) {
// TODO Auto-generated method stubString name1 = username.getText().toString();
String pasd1 = password.getText().toString();
if(name1=="qq"||pasd1=="qq"){
Intent intent=new Intent();
intent.setClass(Logining1Activity.this, Mainface.class);
startActivity(intent);
Logining1Activity.this.finish();
}
else{
Toast.makeText(Logining1Activity.this,
R.string.wrong, 1).show();
}
}
});
}
}在如上的Activity中我该怎样使用Bitmap方法,或者还有更好的办法
比比实力!!!!!!!
/** Called when the activity is first created. */
EditText username;
EditText password;
CheckBox p1,p2,p3,p4;
Button logining;
String name;
String pasd;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
username=(EditText)findViewById(R.id.autocomplete);
password=(EditText)findViewById(R.id.password);
p1=(CheckBox)findViewById(R.id.plain_cb1);
p2=(CheckBox)findViewById(R.id.plain_cb2);
p3=(CheckBox)findViewById(R.id.plain_cb3);
p4=(CheckBox)findViewById(R.id.plain_cb4);
logining=(Button)findViewById(R.id.logining);
p1.setOnClickListener(new OnClickListener() {public void onClick(View v) {
// TODO Auto-generated method stub
name = username.getText().toString();
pasd = password.getText().toString();
SharedPreferences sp = getSharedPreferences("preferences", Context.MODE_PRIVATE);
Editor editor = sp.edit(); editor.putString("name", name); editor.putString("password", pasd);
if (editor.commit()) Toast.makeText(Logining1Activity.this, R.string.save_success, 1).show(); else
Toast.makeText(Logining1Activity.this,
R.string.save_failed, 1).show();
}
});
logining.setOnClickListener(new OnClickListener() {public void onClick(View v) {
// TODO Auto-generated method stubString name1 = username.getText().toString();
String pasd1 = password.getText().toString();
if(name1=="qq"||pasd1=="qq"){
Intent intent=new Intent();
intent.setClass(Logining1Activity.this, Mainface.class);
startActivity(intent);
Logining1Activity.this.finish();
}
else{
Toast.makeText(Logining1Activity.this,
R.string.wrong, 1).show();
}
}
});
}
}在如上的Activity中我该怎样使用Bitmap方法,或者还有更好的办法
比比实力!!!!!!!
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货