Implement click on a picture button to jump to an action
Imageviewschoolcard = (ImageView) View.findviewbyid (r.id.imageviewlostthings);
Imageviewschoolcard.setonclicklistener (New Onclicklistener () {
@Override
public void OnClick (View v) {
Intent Intent = new Intent ();
Intent.putextra ("index", index);
Intent.setclass (Getactivity (), shiwuzhaoling.class);
Startactivityforresult (Intent, 0);
}
});
Implement an action to jump to an XML
public void OnCreate (Bundle savedinstancestate) {
Super.oncreate (savedinstancestate);
Setcontentview (R.layout.postmain);
Add a return button
Getactionbar (). Setdisplayhomeasupenabled (True);
New add action to register to Androidmanifest.xml
Jump to a fragment
Fragmentmanager Fragmentmanager = Getsupportfragmentmanager ();
Fragmenttransaction fragmenttransaction = Fragmentmanager.
BeginTransaction ();
Post2fragment fragment = new Post2fragment ();
Add it to the activity.
Fragmenttransaction.add (r.id.fragment_content,fragment);
Add to the background stack, there is the next line of code, click the Back button is back to the activity interface, no, direct exit activity
The following parameter is the tag of this fragment. Equivalent to ID
Remember to submit
Fragmenttransaction.commit ();
Server segment Modify CS file to add a class on DATAINFO.EDMX when you add a CS file
Remember to generate a publication after you modify it
Android Development Diary (i)