How do I make a 'button click action' on one page open the next in Android studio using Navigation Graphical tool?How do I get a button to open another activity?bufferedReader for URL throws IOExceptionGetting an exception when app startsHow do I make shuffle playlist button and repeat button in android studioMultiple buttons in single page navigating each button to different page in android studiosetText on button from another activity androiddalvikvm: Could not find classAdding Social Media Share Logic From Firebase in AndroidOSMDROID - loading .map file downloaded from mapsforgeActivity can still call unbind service method. Is it normal?java.lang.NullPointerException when invoking onLoadFinished()

Can I travel from Germany to England alone as an unaccompanied minor?

How to securely dispose of a smartphone?

Can European countries bypass the EU and make their own individual trade deal with the U.S.?

Could human civilization live 150 years in a nuclear-powered aircraft carrier colony without resorting to mass killing/ cannibalism?

Copy group of files (Filename*) to backup (Filename*.bak)

Are all commands with an optional argument fragile?

Different budgets within roommate group

Sacrifice blocking creature before damage is dealt no longer working (MtG Arena)?

13th chords on guitar

Are gliders susceptible to bird strikes?

Why do I need two parameters in an HTTP parameter pollution attack?

Can a stressful Wish's Strength reduction be cured early by a Greater Restoration spell?

Sharing referee/AE report online to point out a grievous error in refereeing

How do we separate rules of logic from non-logical constraints?

What is "oversubscription" in Networking?

The warming up game

How can I tell what kind of genitals people have without gender?

Why wasn't ASCII designed with a contiguous alphanumeric character order?

Why is Japan trying to have a better relationship with Iran?

What kind of jet plane is this?

Single level file directory

What will happen if I checked in for another room in the same hotel, but not for the booked one?

How do I tell the reader that my character is autistic in Fantasy?

How is this practical and very old scene shot?



How do I make a 'button click action' on one page open the next in Android studio using Navigation Graphical tool?


How do I get a button to open another activity?bufferedReader for URL throws IOExceptionGetting an exception when app startsHow do I make shuffle playlist button and repeat button in android studioMultiple buttons in single page navigating each button to different page in android studiosetText on button from another activity androiddalvikvm: Could not find classAdding Social Media Share Logic From Firebase in AndroidOSMDROID - loading .map file downloaded from mapsforgeActivity can still call unbind service method. Is it normal?java.lang.NullPointerException when invoking onLoadFinished()






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








0















I'm new to android studio and Java programming. I'm stuck trying to figure out how the graphical navigation Resource feature is used to link pages visually. I've made 2 pages for my app each with unique names (e.g. Page1 & Page2). I've also been able to link the two pages visually by dragging and dropping the round circle in the Graphic Navigation panel and named the action (e.g. action 1).



I followed the solutions offered in this thread How do I get a button to open another activity in Android Studio? but none of them worked for me.



This is my button's code.



public class MainActivity extends AppCompatActivity 
private Button register_button;

@Override
protected void onCreate(Bundle savedInstanceState)
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);


register_button = (Button) findViewById(R.id.action_mainActivity_to_registration);
register_button.setOnClickListener(new View.OnClickListener()
@Override
public void onClick(View v)
openRegistrationPage();

);




public void openRegistrationPage ()

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




I would want the next page to open a=when one button is clicked.










share|improve this question
























  • your code is correct, does it open new activity?

    – Praveen GM
    Mar 25 at 14:22











  • It doesn't. When I run the app on my phone, and click on the button, the app closes.

    – Mango
    Mar 26 at 7:02











  • Can you share the error log

    – Praveen GM
    Mar 26 at 7:28











  • How do I get that on my phone? I couldn't make an emulator on my PC

    – Mango
    Mar 26 at 8:28











  • while you run the app stay connect via adb you can see the error log on Android Studio in Logcat

    – Praveen GM
    Mar 26 at 11:55

















0















I'm new to android studio and Java programming. I'm stuck trying to figure out how the graphical navigation Resource feature is used to link pages visually. I've made 2 pages for my app each with unique names (e.g. Page1 & Page2). I've also been able to link the two pages visually by dragging and dropping the round circle in the Graphic Navigation panel and named the action (e.g. action 1).



I followed the solutions offered in this thread How do I get a button to open another activity in Android Studio? but none of them worked for me.



This is my button's code.



public class MainActivity extends AppCompatActivity 
private Button register_button;

@Override
protected void onCreate(Bundle savedInstanceState)
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);


register_button = (Button) findViewById(R.id.action_mainActivity_to_registration);
register_button.setOnClickListener(new View.OnClickListener()
@Override
public void onClick(View v)
openRegistrationPage();

);




public void openRegistrationPage ()

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




I would want the next page to open a=when one button is clicked.










share|improve this question
























  • your code is correct, does it open new activity?

    – Praveen GM
    Mar 25 at 14:22











  • It doesn't. When I run the app on my phone, and click on the button, the app closes.

    – Mango
    Mar 26 at 7:02











  • Can you share the error log

    – Praveen GM
    Mar 26 at 7:28











  • How do I get that on my phone? I couldn't make an emulator on my PC

    – Mango
    Mar 26 at 8:28











  • while you run the app stay connect via adb you can see the error log on Android Studio in Logcat

    – Praveen GM
    Mar 26 at 11:55













0












0








0








I'm new to android studio and Java programming. I'm stuck trying to figure out how the graphical navigation Resource feature is used to link pages visually. I've made 2 pages for my app each with unique names (e.g. Page1 & Page2). I've also been able to link the two pages visually by dragging and dropping the round circle in the Graphic Navigation panel and named the action (e.g. action 1).



I followed the solutions offered in this thread How do I get a button to open another activity in Android Studio? but none of them worked for me.



This is my button's code.



public class MainActivity extends AppCompatActivity 
private Button register_button;

@Override
protected void onCreate(Bundle savedInstanceState)
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);


register_button = (Button) findViewById(R.id.action_mainActivity_to_registration);
register_button.setOnClickListener(new View.OnClickListener()
@Override
public void onClick(View v)
openRegistrationPage();

);




public void openRegistrationPage ()

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




I would want the next page to open a=when one button is clicked.










share|improve this question
















I'm new to android studio and Java programming. I'm stuck trying to figure out how the graphical navigation Resource feature is used to link pages visually. I've made 2 pages for my app each with unique names (e.g. Page1 & Page2). I've also been able to link the two pages visually by dragging and dropping the round circle in the Graphic Navigation panel and named the action (e.g. action 1).



I followed the solutions offered in this thread How do I get a button to open another activity in Android Studio? but none of them worked for me.



This is my button's code.



public class MainActivity extends AppCompatActivity 
private Button register_button;

@Override
protected void onCreate(Bundle savedInstanceState)
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);


register_button = (Button) findViewById(R.id.action_mainActivity_to_registration);
register_button.setOnClickListener(new View.OnClickListener()
@Override
public void onClick(View v)
openRegistrationPage();

);




public void openRegistrationPage ()

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




I would want the next page to open a=when one button is clicked.







java android button navigation






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 25 at 15:21









Zoe

15.9k9 gold badges62 silver badges94 bronze badges




15.9k9 gold badges62 silver badges94 bronze badges










asked Mar 25 at 14:14









MangoMango

12 bronze badges




12 bronze badges












  • your code is correct, does it open new activity?

    – Praveen GM
    Mar 25 at 14:22











  • It doesn't. When I run the app on my phone, and click on the button, the app closes.

    – Mango
    Mar 26 at 7:02











  • Can you share the error log

    – Praveen GM
    Mar 26 at 7:28











  • How do I get that on my phone? I couldn't make an emulator on my PC

    – Mango
    Mar 26 at 8:28











  • while you run the app stay connect via adb you can see the error log on Android Studio in Logcat

    – Praveen GM
    Mar 26 at 11:55

















  • your code is correct, does it open new activity?

    – Praveen GM
    Mar 25 at 14:22











  • It doesn't. When I run the app on my phone, and click on the button, the app closes.

    – Mango
    Mar 26 at 7:02











  • Can you share the error log

    – Praveen GM
    Mar 26 at 7:28











  • How do I get that on my phone? I couldn't make an emulator on my PC

    – Mango
    Mar 26 at 8:28











  • while you run the app stay connect via adb you can see the error log on Android Studio in Logcat

    – Praveen GM
    Mar 26 at 11:55
















your code is correct, does it open new activity?

– Praveen GM
Mar 25 at 14:22





your code is correct, does it open new activity?

– Praveen GM
Mar 25 at 14:22













It doesn't. When I run the app on my phone, and click on the button, the app closes.

– Mango
Mar 26 at 7:02





It doesn't. When I run the app on my phone, and click on the button, the app closes.

– Mango
Mar 26 at 7:02













Can you share the error log

– Praveen GM
Mar 26 at 7:28





Can you share the error log

– Praveen GM
Mar 26 at 7:28













How do I get that on my phone? I couldn't make an emulator on my PC

– Mango
Mar 26 at 8:28





How do I get that on my phone? I couldn't make an emulator on my PC

– Mango
Mar 26 at 8:28













while you run the app stay connect via adb you can see the error log on Android Studio in Logcat

– Praveen GM
Mar 26 at 11:55





while you run the app stay connect via adb you can see the error log on Android Studio in Logcat

– Praveen GM
Mar 26 at 11:55












1 Answer
1






active

oldest

votes


















0














Make sure you declare your activities in Manifest file like this



 <activity android:name=".YOUR_ACTIVITY" />


And in you Button action, make the navigation action like this



 Intent intent = new Intent(YOUR_ACTIVITY_1.this, YOUR_ACTIVITY_2.class);
startActivity(intent);





share|improve this answer























  • My Manifest looks like this. I think the declarations were made just as you've suggested automatically. <activity android:name=".registration" /> <activity android:name=".MainActivity"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity>

    – Mango
    Mar 26 at 7:06











Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55339829%2fhow-do-i-make-a-button-click-action-on-one-page-open-the-next-in-android-studi%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









0














Make sure you declare your activities in Manifest file like this



 <activity android:name=".YOUR_ACTIVITY" />


And in you Button action, make the navigation action like this



 Intent intent = new Intent(YOUR_ACTIVITY_1.this, YOUR_ACTIVITY_2.class);
startActivity(intent);





share|improve this answer























  • My Manifest looks like this. I think the declarations were made just as you've suggested automatically. <activity android:name=".registration" /> <activity android:name=".MainActivity"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity>

    – Mango
    Mar 26 at 7:06
















0














Make sure you declare your activities in Manifest file like this



 <activity android:name=".YOUR_ACTIVITY" />


And in you Button action, make the navigation action like this



 Intent intent = new Intent(YOUR_ACTIVITY_1.this, YOUR_ACTIVITY_2.class);
startActivity(intent);





share|improve this answer























  • My Manifest looks like this. I think the declarations were made just as you've suggested automatically. <activity android:name=".registration" /> <activity android:name=".MainActivity"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity>

    – Mango
    Mar 26 at 7:06














0












0








0







Make sure you declare your activities in Manifest file like this



 <activity android:name=".YOUR_ACTIVITY" />


And in you Button action, make the navigation action like this



 Intent intent = new Intent(YOUR_ACTIVITY_1.this, YOUR_ACTIVITY_2.class);
startActivity(intent);





share|improve this answer













Make sure you declare your activities in Manifest file like this



 <activity android:name=".YOUR_ACTIVITY" />


And in you Button action, make the navigation action like this



 Intent intent = new Intent(YOUR_ACTIVITY_1.this, YOUR_ACTIVITY_2.class);
startActivity(intent);






share|improve this answer












share|improve this answer



share|improve this answer










answered Mar 25 at 14:23









AmineAmine

1,0851 gold badge4 silver badges15 bronze badges




1,0851 gold badge4 silver badges15 bronze badges












  • My Manifest looks like this. I think the declarations were made just as you've suggested automatically. <activity android:name=".registration" /> <activity android:name=".MainActivity"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity>

    – Mango
    Mar 26 at 7:06


















  • My Manifest looks like this. I think the declarations were made just as you've suggested automatically. <activity android:name=".registration" /> <activity android:name=".MainActivity"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity>

    – Mango
    Mar 26 at 7:06

















My Manifest looks like this. I think the declarations were made just as you've suggested automatically. <activity android:name=".registration" /> <activity android:name=".MainActivity"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity>

– Mango
Mar 26 at 7:06






My Manifest looks like this. I think the declarations were made just as you've suggested automatically. <activity android:name=".registration" /> <activity android:name=".MainActivity"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity>

– Mango
Mar 26 at 7:06









Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.







Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.



















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55339829%2fhow-do-i-make-a-button-click-action-on-one-page-open-the-next-in-android-studi%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

SQL error code 1064 with creating Laravel foreign keysForeign key constraints: When to use ON UPDATE and ON DELETEDropping column with foreign key Laravel error: General error: 1025 Error on renameLaravel SQL Can't create tableLaravel Migration foreign key errorLaravel php artisan migrate:refresh giving a syntax errorSQLSTATE[42S01]: Base table or view already exists or Base table or view already exists: 1050 Tableerror in migrating laravel file to xampp serverSyntax error or access violation: 1064:syntax to use near 'unsigned not null, modelName varchar(191) not null, title varchar(191) not nLaravel cannot create new table field in mysqlLaravel 5.7:Last migration creates table but is not registered in the migration table

은진 송씨 목차 역사 본관 분파 인물 조선 왕실과의 인척 관계 집성촌 항렬자 인구 같이 보기 각주 둘러보기 메뉴은진 송씨세종실록 149권, 지리지 충청도 공주목 은진현