i have already this exception in my app but i want to create a custom dialog
heres my exception:
10-11 01:41:49.420: E/AACPlayer(649): playAsync():
10-11 01:41:49.420: E/AACPlayer(649): java.lang.RuntimeException:
Cannot start native decoder
and instead of show this java.lang.RuntimeException: Cannot start native decoder to person, show like Error!! stream is down.
i tried something like this:
try
{
aacPlayer.playAsync( getUrl());
}
catch(Exception e)
{
AlertDialog alertDialog = new AlertDialog.Builder(Activity.this).create();
alertDialog.setTitle("Error in radio");
alertDialog.setMessage("out of service");
alertDialog.setButton("OK", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
// here you can add functions
}
});
alertDialog.setIcon(R.drawable.icon);
alertDialog.show();
}
but without luck it doesnt shows the custom dialog what can recommend me for this?
thanks very much.
See it, maybe it can help you 😉
How to catch a ‘java.lang.RuntimeException’ or Throwing and Catching Exceptions