When getting the button from the xml file, cast the view to Button. Use the following Button clickmeButton = (Button) findViewById(R.id. Clickme_button) instead of View clickmeButton = findViewById(R.id.
Clickme_button) And by popup what do you mean. Do you want to show a Dialog? Because your code will just start another activity.To get a popup, use Dialogs.
Read about AlertDialog here: http://developer.android.com/guide/topics/ui/dialogs.html.
When getting the button from the xml file, cast the view to Button. Use the following, Button clickmeButton = (Button) findViewById(R.id. Clickme_button); instead of View clickmeButton = findViewById(R.id.
Clickme_button); And by popup what do you mean. Do you want to show a Dialog? Because your code will just start another activity.To get a popup, use Dialogs.
Read about AlertDialog here: http://developer.android.com/guide/topics/ui/dialogs.html .
Button clickmeButton = (Button) findViewById(R.id. Clickme_button); no need of theme for PopUP activity.
I am genuinely curious about this. Can you clarify some more as to where the ArrayIndexOutOfBoundsException happens here, and how specifying the View implementation fixes it? Thanks!
– nicholas. Hauschild May 18 at 17:34 @bdhar:is this solve you r problem. – Sumant May 18 at 17:38 Sorry, it did not solve my problem.
– bdhar May 20 at 7:23 @bdhar you have to set Id first like clickmeButton. SetId(1);also in popup. Xml give layout_width & layout_height parameters to textview.
– Sumant Jun 6 at 16:43.
I'm exploring and learning how to program the android phone and right now I have 2 classes (MainActivity and SubActivity and 2 layouts (main and subactivity). In MainActivity, I have a button, when I click on the button, I want to show th subactivity layout and execute the SubActivity activity so that I can click on the the button there and return to the MainActivity. The following is the layout of main.
I get a runtime error when I click on the button on main layout.
I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.