• 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

NPE on hallo world code

 
Ranch Hand
Posts: 606
11
Android Python Open BSD VI Editor Slackware
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dear All despite I am trying since 4 days, I cannot make a string recognizable by Java, the emulator crashes, and I showed it to several senior developers and they cannot help me, despite the code is really easy
thank you


this is the fragment_main.xml


and this is the logcat error

 
Bartender
Posts: 11497
19
Android Google Web Toolkit Mac Eclipse IDE Ubuntu Java
  • Likes 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

this is the fragment_main.xml


Does this seem right?
 
Giovanni Montano
Ranch Hand
Posts: 606
11
Android Python Open BSD VI Editor Slackware
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dear Maneesh,thank you i would say not is not right, but only because i would suppose it is not because otherwise you would not ask me.
unfortunately, I do not understand, with some common sense I would say not. but I do not understand what you mean.
Yesterday with common sense I thought:" ehy under res layout there are two files activity_main and fragment_main, so I tried to use the graphical editor to drag some text( but it looked not feasible because all the buttons and widgets I was dragging where overlapping one on top of the other), and eclipse open me as defaulti this fragment main, so probably also if I write in main, as I do not see inside the code another place where to write I should put it in fragment!"

probably I was wrong, but still I do not undestand what I should do now to make it work, i am really newbe sorry
 
Rancher
Posts: 43081
77
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Since you posted fragment_main I'm guessing you assumed it would be used, correct? If so, then the problem is what Maneesh noticed - your code actually uses activity_main. So you should fix that.

But activity_main seems to exist, because if it didn't, you would have gotten a compiler error. So if you are not using that, you should delete it to head off any further confusion.
 
Giovanni Montano
Ranch Hand
Posts: 606
11
Android Python Open BSD VI Editor Slackware
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thank you now is working:)
reply
    Bookmark Topic Watch Topic
  • New Topic