• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Why not correct run my program?

 
Ranch Hand
Posts: 85
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Is the onClick method being called? Are there any exceptions in the logcat output?
 
fahimeh hashemian
Ranch Hand
Posts: 85
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Ulf Dittmer wrote:Is the onClick method being called? Are there any exceptions in the logcat output?



Thanks for answer. I copy logCat and past here:

10-22 23:18:52.549: D/OpenGLRenderer(11209): Flushing caches (mode 0)
10-22 23:18:52.705: D/OpenGLRenderer(11209): Flushing caches (mode 1)
10-22 23:19:03.823: D/libEGL(11269): loaded /system/lib/egl/libGLES_android.so
10-22 23:19:03.830: D/libEGL(11269): loaded /vendor/lib/egl/libEGL_POWERVR_SGX540_120.so
10-22 23:19:03.838: D/libEGL(11269): loaded /vendor/lib/egl/libGLESv1_CM_POWERVR_SGX540_120.so
10-22 23:19:03.838: D/libEGL(11269): loaded /vendor/lib/egl/libGLESv2_POWERVR_SGX540_120.so
10-22 23:19:03.932: D/OpenGLRenderer(11269): Enabling debug mode 0
10-22 23:22:47.174: D/dalvikvm(11269): GC_FOR_ALLOC freed 149K, 2% free 14272K/14535K, paused 35ms
10-22 23:26:21.893: D/OpenGLRenderer(11269): Flushing caches (mode 0)
10-22 23:26:22.034: D/OpenGLRenderer(11269): Flushing caches (mode 1)
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Is that all? There aren't even messages about the app being started, so it doesn't seem to be the full output. Also:

Is the onClick method being called?

 
fahimeh hashemian
Ranch Hand
Posts: 85
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Ulf Dittmer wrote:Is that all? There aren't even messages about the app being started, so it doesn't seem to be the full output. Also:

Is the onClick method being called?


I unistalled the program on the phone and run the program again. I copy everything writes in logCat tab:

10-22 23:42:15.096: D/libEGL(12120): loaded /system/lib/egl/libGLES_android.so
10-22 23:42:15.096: D/libEGL(12120): loaded /vendor/lib/egl/libEGL_POWERVR_SGX540_120.so
10-22 23:42:15.104: D/libEGL(12120): loaded /vendor/lib/egl/libGLESv1_CM_POWERVR_SGX540_120.so
10-22 23:42:15.104: D/libEGL(12120): loaded /vendor/lib/egl/libGLESv2_POWERVR_SGX540_120.so
10-22 23:42:15.205: D/OpenGLRenderer(12120): Enabling debug mode 0
10-22 23:42:15.354: D/dalvikvm(12120): GC_CONCURRENT freed 185K, 3% free 14279K/14599K, paused 3ms+3ms

I dont know what should i know the onClick method being called or not? Please explain for me.
Thank you. Cheers.
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can put a Log.i method call into the onClick handler.
 
fahimeh hashemian
Ranch Hand
Posts: 85
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Ulf Dittmer wrote:You can put a Log.i method call into the onClick handler.



I edit the loyaltier.java class:



Do i correct write log.i("test","I AM HERE"); ? I copy logCat and paste in below:

10-24 00:30:55.038: D/libEGL(5340): loaded /system/lib/egl/libGLES_android.so
10-24 00:30:55.046: D/libEGL(5340): loaded /vendor/lib/egl/libEGL_POWERVR_SGX540_120.so
10-24 00:30:55.046: D/libEGL(5340): loaded /vendor/lib/egl/libGLESv1_CM_POWERVR_SGX540_120.so
10-24 00:30:55.053: D/libEGL(5340): loaded /vendor/lib/egl/libGLESv2_POWERVR_SGX540_120.so
10-24 00:30:55.139: D/OpenGLRenderer(5340): Enabling debug mode 0
10-24 00:31:00.960: D/OpenGLRenderer(5340): Flushing caches (mode 0)
10-24 00:31:01.022: D/OpenGLRenderer(5340): Flushing caches (mode 1)
10-24 00:31:01.499: D/dalvikvm(5340): GC_FOR_ALLOC freed 167K, 2% free 14272K/14535K, paused 19ms

Where is my problem? How to fix it?
Thank you. Cheers.
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 85
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks.I download my program and if you can please read my code and say to me, what is my problem? Cheers.
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 85
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 85
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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?

stackoverflow

Sorry for my questions.
Thank you.
Cheers.
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 85
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?")
 
Bring me the box labeled "thinking cap" ... and then read this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic