In login activity, intent is not working

SparrOw

In this activity when both password and username are correct then I have shown a toast and an intent to move to next screen after login, but only toast works, intent is not working?

btnSignIn.setOnClickListener(new View.OnClickListener() {

    public void onClick(View v) {
        // get The User name and Password
        String userName = editTextUserName.getText().toString();
        String password = editTextPassword.getText().toString();

        // fetch the Password form database for respective user name
        String storedPassword = loginDataBaseAdapter.getSinlgeEntry(userName);

        // check if the Stored password matches with Password entered by
        // user
        if (password.equals(storedPassword)) {
            Toast.makeText(HomeActivity.this, "Congrats: Login Successfull",
                    Toast.LENGTH_LONG).show();
            dialog.dismiss();
            Intent intent = new Intent(getApplicationContext(), ViewFolders.class);
            startActivity(intent);

        } else {
            Toast.makeText(HomeActivity.this, "User Name or Password does not match",
                    Toast.LENGTH_LONG).show();
        }
    }
});

After login it is not moving to ViewFolders.class

Jitesh Upadhyay

Use:

Intent intent=new Intent(HomeActivity.this,ViewFolders.class);
startActivity(intent);

Instead of:

Intent intent=new Intent(getApplicationContext(),ViewFolders.class);
startActivity(intent);

Beside this hope ViewFolders activity is added to manifest already

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Intent not working - Activity not found

From Dev

Intent is not working for moving fragment to activity

From Dev

Working with multiple activity and keeping the same value of intent

From Dev

intent to next activity, toast, progress bar not working

From Dev

android Intent.FLAG_ACTIVITY_REORDER_TO_FRONT not working as intended

From Dev

Why is the email Intent not working from Common (non Activity) class

From Dev

Get the Intent that resumes the activity

From Dev

How to receive Intent in Activity

From Dev

Passthrough intent filter and activity

From Dev

back to previous activity with intent

From Dev

Android Intent, Fragment and Activity

From Dev

Intent JSONObject to another activity

From Dev

Camera Intent destroys Activity

From Dev

startActivity(intent) is not opening activity

From Dev

using multiple intent in an activity

From Dev

Launch activity with intent

From Dev

Bring activity to front with intent

From Dev

Starting activity intent in AndEngine

From Dev

Android Intent, Fragment and Activity

From Dev

Activity is destroyed on intent creation

From Dev

Android Intent Activity Logic?

From Dev

Receiving intent from activity

From Dev

using multiple intent in an activity

From Dev

No Activity found to handle Intent

From Dev

Passthrough intent filter and activity

From Dev

Get current activity in base activity intent

From Dev

Close activity from another activity through an intent

From Dev

how to intent the same activity instead of second activity

From Dev

Close activity from another activity through an intent