Add button and listen, this is different from the last one, it is not in a dialog, but a new activity, so you need to find the activity of the entrance.
Case R.id.checkframe: if (mcurrentmodule instanceof photomodule) { Photoui UI = ((Photomodule) mcurrentmodule). Getphotouiinstance (); if (UI! = null) { Photoframeupdatemanager Photoframemanager = new Photoframeupdatemanager (cameraactivity.this , UI); if (photoframemanager.isnetworkconnected ()) {// photoframemanager.checkupdate (); Startactivityforresult (New Intent (Cameraactivity.this, Kuangdownloadactivity.class), req_code_download); } else { photoframemanager.shownetworkdialog ();}} } Break
Checkframe in the public listener class, and when found, see
Startactivityforresult (New Intent (Cameraactivity.this, Kuangdownloadactivity.class), req_code_download); Create a new activity, called Kuangdownloadactivity, click Enter, and then change the layout file first,
See Setcontentview (R.layout.kuang_download_main); Click to enter
<relativelayout style= "@style/kuangtopbar" > <textview style= "@style/kuangtopbar_text" android:text= "@string/photoframe_check"/> <button android:id= "@+id/backbutton2" android: Layout_width= "@dimen/about_title_height" android:layout_height= "@dimen/about_title_height" android: Layout_centervertical= "true" android:layout_marginleft= "@dimen/about_title_btn_margin_left" android: background= "@drawable/about_back"/> </RelativeLayout>
where style= "@style/kuangtopbar" defines a style click to modify the style
<style name= "Kuangtopbar" > <item name= "android:gravity" >center_vertical</item> < Item Name= "Android:orientation" >horizontal</item> <item name= "Android:background" > @drawable/ photoframe_title</item> <item name= "Android:paddingleft" >5dip</item> <item name= " Android:paddingright ">5dip</item> <item name=" Android:layout_width ">fill_parent</item> <item name= "android:layout_height" >48dp</item> </style>
Modified to go back to the activity to modify the Add button to fix.
protected void OnCreate (Bundle savedinstancestate) {//TODO auto-generated method Stubsuper.oncreate ( Savedinstancestate); Setcontentview (r.layout.kuang_download_main); kuanglist = (ListView) Findviewbyid ( r.id.viewbooklist); adapter = new Kuangitemadapter (this,kuanglist); Loadstateview = (Loadstateview) Findviewbyid ( R.id.downloadstatusbox); Button Backbutton2 = (button) Findviewbyid (R.id.backbutton2); Backbutton2.setonclicklistener (new View.onclicklistener () {public void OnClick (View v) { finish ();
Return to the upper menu, direct finish (); just fine.
Android Footstep---UI modification, adding buttons and listening to activity