I want to create a page that bottom of page is 5 buttons and the rest of the page is for when user press one of the buttons. I created this but when i pressed Home button, the program does nothing and not open html file. Why?
res/layout/activity_main.xml
res/values/colors.xml
res/values/strings.xml
assets/index.html
home.java
Ulf Dittmer
Marshal
Joined: Mar 22, 2005
Posts: 35237
7
posted
0
Is the onClick method being called? Are there any exceptions in the logcat output?
Where is my problem? How to fix it?
Thank you. Cheers.
Ulf Dittmer
Marshal
Joined: Mar 22, 2005
Posts: 35237
7
posted
0
If that's really the entire logcat output - and it doesn't really look like it is, you should verify that writing to the log works by adding more Log.i calls to your code, e.g. at the start of the onCreate method- then it would seem that the onClick handler is not being called.
fahimeh hashemian
Ranch Hand
Joined: Aug 07, 2012
Posts: 56
posted
0
Thanks.I download my program and if you can please read my code and say to me, what is my problem? Cheers.
Ulf Dittmer
Marshal
Joined: Mar 22, 2005
Posts: 35237
7
posted
0
I'm not sure what the problem is. That's why I suggested you start debugging the issue by putting log statement all over the code, so that you can be sure about which code is executed, and which is not. So far, I'm not even convinced that logging works, though.
fahimeh hashemian
Ranch Hand
Joined: Aug 07, 2012
Posts: 56
posted
0
I couldnt see logCat of previous my program because i write other program again and add log.i() function to my code. I write the code and logCat of program. I think when button clicked, the program not load web page. Why? Please please help me.
MainActivity:
Activity_main.xml
strings.xml
LogCat:
Cheers
Ulf Dittmer
Marshal
Joined: Mar 22, 2005
Posts: 35237
7
posted
0
Are you really using spaces in your android_id attributes, or is that just an artifact of copy/paste?
Edit: Scratch that; I now see that it's a browser thing.
fahimeh hashemian
Ranch Hand
Joined: Aug 07, 2012
Posts: 56
posted
0
Ulf Dittmer wrote:Are you really using spaces in your android_id attributes, or is that just an artifact of copy/paste?
Edit: Scratch that; I now see that it's a browser thing.
Thanks for answer.
I also ask this question in stackoverflow site and they say to me that i forgot add internet permission to AndroidManifest.xml and i add this to androidManifest.xml, the program runs but when i changed my code and add Go.java to my project and changed MainActivity , the program not runs again Why? Where and what is the problem?
You probably didn't change it everywhere it needs to be changed, like in the manifest. Are there any exceptions in the stack trace?
fahimeh hashemian
Ranch Hand
Joined: Aug 07, 2012
Posts: 56
posted
0
Thanks for help
I copy MainActivity and Go.java and strings and ... in below. Where is the problem? Do i have any problem in code? if you need any file of my program, please tell me, so i write that.
Go.java
MainActivity:
Activity_main.xml:
strings.xml:
AndroidManifest.xml:
Cheers.
Ulf Dittmer
Marshal
Joined: Mar 22, 2005
Posts: 35237
7
posted
0
Start with this:
Ulf Dittmer wrote:Are there any exceptions in the stack trace?
(I didn't really mean "stack trace", I meant "logcat output", but either way, the important part is "are there any exceptions?")