I know this has probably been asked a million times, and I have searched. this question originally started from my wanting to have an activity with some buttons and when one was clicked before sending over to the next activity check for null variables and if some where found show a toast. I have since for bug checking removed the null variable checking segment to just show the variables. A very barebones and simplified code of the situation is like so
public Class MyClass extends Activity {
EditText et1;
EditText et2;
Button btn1;
String et1string;
String et2string;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.mylayout);
et1 = (EditText) findViewById(R.id.et1);
et2 = (EditText) findViewById(R.id.et2);
btn1 = (Button) findViewById(R.id.btn1);
btn1.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
et1string = et1.getText().toString();
et2string = et2.getText().toString();
Log.d(getClass().getName(), "et1string =" + et1string + " and et2string =" + et2string);
Toast.makeText(getApplicationContext(), "et1string =" + et1string + " and et2string =" + et2string, Toast.LENGTH_LONG);
}
});
}
I have tried using the following in place of the Toast.makeText
runOnUiThread(new Runnable() {
@Override
public void run() {
Toast.makeText(getApplicationContext(), "et1string =" + et1string + " and et2string =" + et2string, Toast.LENGTH_LONG);
}
});
Either way there is no toast message that is shown.
I am sure i am doing something easily noticed by a guru, but just has me puzzled. the logcat shows the logd, and this isnt application dependant, I would just like to figure out why i cant get a toast to show up
Also Ive read that notifications can be disabled? idk, but I am programming with the version 23 sdk so if there is a permissions i need to ask for some guidance on that would be great