Toast.makeText(getActivity(), (String)data.result,
Toast.LENGTH_LONG).show();
Toast.makeText(getActivity(), "this is my Toast message!!! =)",
Toast.LENGTH_LONG).show();
You can do it like this.
For LENGTH_LONG, the Toast is shown for a long time LENGTH_SHORT appears short.
```LayoutInflater myInflater=LayoutInflater.from(this); View view=myInflater.inflate(R.layout.your_custom_layout,null); Toast mytoast=new Toast(this); mytoast.setView(view); mytoast.setDuration(Toast.LENGTH_LONG); mytoast.show();
If you do it like this, you can print out a custom toast.
© 2024 OneMinuteCode. All rights reserved.