This article describes the method of coexisting Toast prompt box graphics and text on Android. Share it for your reference, as follows:
The procedure is as follows:
import ; import ; import ; import ; import ; import ; import ; import ; import ; import ; import ; import ; public class A05Activity extends Activity { private Button b; /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { (savedInstanceState); setContentView(); b=(Button)findViewById(); ("Show Toast"); (); (new OnClickListener(){ @Override public void onClick(View v) { // TODO Auto-generated method stub ImageView iv=new ImageView(); (); TextView tv=new TextView(); (); LinearLayout ll=new LinearLayout(); //Judge what format the content in the TextView is and connect it to the system (tv, Linkify.PHONE_NUMBERS|Linkify.EMAIL_ADDRESSES|Linkify.WEB_URLS); Toast t=(, (), Toast.LENGTH_LONG); View v1=(); (); (iv); (v1); (ll); //Set the relative position of the Toast object in the phone (, 50, 50); (); } }); } }
Note: Because Toast belongs to the Context in Activiyt, the connection in Toast cannot be clicked. For example, if there is a URL in Toast, you cannot open it with double-click to double-click to enter it in Toast.
For more information about Android related content, please check out the topic of this site:Android control usage summary"and"Android development introduction and advanced tutorial》
I hope this article will be helpful to everyone's Android programming design.