Closed Waseemnajibsufyan closed 10 months ago
I need to fetch access token from the Url in my code I have got the access token as a Url , but i am not able to fetch it into my code after expire . Could anybody help me giving the code
Attempt to invoke virtual method 'void android.widget.Button.setOnClickListener(android.view.View$OnClickListener)' on a null object reference at com.twilio.voice.quickstart.VoiceActivity.onCreate(VoiceActivity.java:133)
Make sure you assign bacreaccesstoken
before using the object itself. i.e. you cannot call a function setOnClickListener
on a null object bacreaccesstoken
.
Note: This is not a Twilio voice error, I'd advise going through some Android tutorials.
@cybex-dev Thank you helping the community out! and yes, this is not an SDK issue, closing.
Attempt to invoke virtual method 'void android.widget.Button.setOnClickListener(android.view.View$OnClickListener)' on a null object reference at com.twilio.voice.quickstart.VoiceActivity.onCreate(VoiceActivity.java:133)
can help me how to correct the error in this code:
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_voice); bacreaccesstoken = findViewById(R.id.reaccesstoken); saveeaccesstoken = findViewById(R.id.reaccesstoken2); send_text = findViewById(R.id.editTextTextPersonName3); receiver_msg = findViewById(R.id.textView2); try { receiver_msg.setText("Hello world"); } catch(Exception e){ Toast.makeText(this,e.getMessage(), Toast.LENGTH_SHORT).show(); }
saveeaccesstoken.setOnClickListener(new View.OnClickListener() {