NullPointerException

How do I make it not null? here is the error on my logcat:
02-05 13:59:14.764 26351-26351/com.example.milespc.funfacts2 E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.milespc.funfacts2, PID: 26351
java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.TextView.setText(java.lang.CharSequ ence)' on a null object reference
at com.example.milespc.funfacts2.MainActivity$1.onCli ck(MainActivity.java:34)

here is the string of code:
factLabel.setText(fact);

Show Accepted Answer

Guest Quick Reply (No URL, BBcode or HTML)

Last post by sanderson
22 minutes ago
Last post by bertha36
52 minutes ago
Last post by isabell62
1 hour ago
Last post by seth98
4 hours ago
Last post by jsatterfield
2 hours ago
Last post by dean61
4 hours ago
Last post by sally.herman
2 hours ago
Last post by smcglynn
2 hours ago
Last post by mcummerata
2 hours ago