Win a copy of Java Persistence with Spring Data and Hibernate this week in the Spring forum!
  • 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
  • Ron McLeod
  • Tim Cooke
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Jeanne Boyarsky
Saloon Keepers:
  • Stephan van Hulst
  • Carey Brown
  • Tim Holloway
  • Piet Souris
Bartenders:

how to switch activity properly without android launcher shooting down

 
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi, I'm working in a project which need to show my MainActivity after i run several java class. i need to run bluetooth> register > MainActivity. MainActivity is the only activity that contain layout. because Bluetooth and register doesn't have layout, i deleted this and ;. I also put intent in my program to refer one activity to another. After that i change my AndroidManifest stuctured like this :

after i open the program, it shut down immediately. can you tell me how to switch activity properly without android launcher shooting down? thank you for your help.
 
Bartender
Posts: 7488
171
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Whenever an activity crashes, the full stack trace is written to the logcat - post it here (NOT the entire content of the logcat, just the relevant bits).
 
nida azizah
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
here's the logcat :

 
nida azizah
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I forget something, i'm also using sqlitedatabase in DatabaseHelper Activity but i can't insert it to AndroidManifest, so i didn't do that. I hope it doesn't cause any problem.
 
Rancher
Posts: 4936
38
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
 

Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.TextView.append(java.lang.CharSequence)' on a null object reference
       at com.example.windows8.registerlogin.Bluetooth.CheckBTState(Bluetooth.java:191)


What variable/value is null on line 191?
 
Tim Moores
Bartender
Posts: 7488
171
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

nida azizah wrote:i'm also using sqlitedatabase in DatabaseHelper Activity but i can't insert it to AndroidManifest, so i didn't do that.


You mean the <provider> element? Why not? That sure sounds like it could cause problems. Also tell us which object is null when you try to call "append" on it, and why.
 
Bartender
Posts: 2270
20
Android Java ME Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


Probably the text view being referred is not inflated from the referred layout xml file properly.
 
When it is used for evil, then watch out! When it is used for good, then things are much nicer. Like this tiny ad:
The Low Tech Laboratory Movie Kickstarter is LIVE NOW!
https://www.kickstarter.com/projects/paulwheaton/low-tech
reply
    Bookmark Topic Watch Topic
  • New Topic