This is my code, where the problem comes up.
public void onClick(View arg0) {
switch (arg0.getId()){
case R.id.login:
String nama = user.getText().toString();
String sandi = pass.getText().toString();
new AttemptLogin().execute(nama,sandi);
break;
}
and then this is my code on the AttemptLogin()
class AttemptLogin extends AsyncTask<String,String,String>{
boolean failure = false;
protected String doInBackground(String... args) {
int success;
String username = args[0] ;
String password = args[1];
try {
List<NameValuePair> params = new ArrayList<NameValuePair>();
params.add(new BasicNameValuePair("username",username));
params.add(new BasicNameValuePair("password",password));
...etc
}
and this is the LogCat,
LogCat : null object reference
So, I want get the String from onClick(), and pass the value to the doInBackground() on attemptLogin(). What is the solution about it? I'm sorry, it's newbie's question, please help us Thank you so much for your atention :)