error when clicking the meme button in meme creator

0 Nara simman · September 21, 2015
In the following logcat lines i have errors
please help to solve this..!!
thank you..!
09-19 20:40:15.602  10917-10917/com.example.dineshpc.memecreator E/AndroidRuntime? FATAL EXCEPTION: main
    Process: com.example.dineshpc.memecreator, PID: 10917
    java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.TextView.setText(java.lang.CharSequence)' on a null object reference
            at com.example.dineshpc.memecreator.bottompicturefragment.setmemetext(bottompicturefragment.java:25)
            at com.example.dineshpc.memecreator.MainActivity.createMeme(MainActivity.java:21)
            at com.example.dineshpc.memecreator.TopSectionfragment.buttonClicked(TopSectionfragment.java:56)
            at com.example.dineshpc.memecreator.TopSectionfragment$1.onClick(TopSectionfragment.java:47)
            at android.view.View.performClick(View.java:4780)
            at android.view.View$PerformClick.run(View.java:19866)
            at android.os.Handler.handleCallback(Handler.java:739)
            at android.os.Handler.dispatchMessage(Handler.java:95)
            at android.os.Looper.loop(Looper.java:135)
            at android.app.ActivityThread.main(ActivityThread.java:5257)
            at java.lang.reflect.Method.invoke(Native Method)
            at java.lang.reflect.Method.invoke(Method.java:372)
            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)

Post a Reply

Replies

Oldest  Newest  Rating
0 Gary Whitney · September 24, 2015
It looks to me like you tried to use the method setText before getting a reference to the view object.
  • 1

Java / Android Development

107,319 followers
About

Very popular language used to create desktop applications, website applets, and Android apps.

Links
Moderators
Bucky Roberts Administrator