Change the lines of code below, to the one's that follow:
Toast toast = new Toast(context);
Toast.makeText(context, tileID, Toast.LENGTH_SHORT);
toast.show();
Change to this:
Toast toast = Toast.makeText(context, tileID, Toast.LENGTH_SHORT);
toast.show();
As you can see from the source code, that exception is thrown only when mNextView is null. The function "makeText" is suppose to set it, and it does, but your original code does not capture the reference to the Toast it builds. Instead, your original code creates two Toasts, and attempts to "show" the one which has not yet had its view set.
public void show() {
if (mNextView == null) {
throw new RuntimeException("setView must have been called");
}
....
public static Toast makeText(Context context, CharSequence text, int duration) {
Toast result = new Toast(context);
LayoutInflater inflate = (LayoutInflater)
context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
View v = inflate.inflate(com.android.internal.R.layout.transient_notification, null);
TextView tv = (TextView)v.findViewById(com.android.internal.R.id.message);
tv.setText(text);
result.mNextView = v;
result.mDuration = duration;
return result;
}