Android Development Diary (i)

Source: Internet
Author: User

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)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.