• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps Providing intent for cards

abhi1237

Lurker
How to give intent for accessing card activity,its not taking usual class.
Below is code snippet im providing. can anyone provide me solution

Java:
public void onClick(View v) {
        if (txtUsername.getText().toString().equals("test") &&
                txtPassword.getText().toString().equals("1234")) {
            Toast.makeText(getApplicationContext(), "Credentials Accepted",
                    Toast.LENGTH_SHORT).show();
            Intent i = new Intent(Login_activity.this, HelloCardActivity.class); //hellocardactivity is another card activity. and login_activity is login page
            startActivity(i);
            Login_activity.this.finish();
        } else {
            Toast.makeText(getApplicationContext(), "Wrong Credentials",
                    Toast.LENGTH_SHORT).show();
        }

    }

pls provide a solution
thank you
 
@abhi1237 What exactly is the issue? The intent looks correct to start HelloCardActivity. Is that not happening? Is it erroring on something? If you are getting an error post that so we can see.
 
Ya ,when I run app on device or emulator ,after running it says unfortunately app has stopped... But its not posing any errors.
 
Ya ,when I run app on device or emulator ,after running it says unfortunately app has stopped... But its not posing any errors.
Posting any errors where? Are you using logcat? ...if not open the terminal and type "adb logcat -v time".

Also, quickly check to see if you have the HelloCardActivity in your manifest. I don't think the error is related to your code you posted above.
 
Posting any errors where? Are you using logcat? ...if not open the terminal and type "adb logcat -v time".

Also, quickly check to see if you have the HelloCardActivity in your manifest. I don't think the error is related to your code you posted above.
ya i checked in logcat its not showing any errors, but in manifest file it has not created any activity related to it...
 
Back
Top Bottom