Help with intent starting on Android -


i trying learn few things http://code.google.com/p/iosched/source/checkout. wanted see how implemented ui patterns talking on i/o.

in homeactivity use code fire notesactivity :

/* launch list of notes user has taken*/ public void onnotesclick(view v) {       startactivity(new intent(intent.action_view, notes.content_uri)); } 

notes class in schedulecontract class , looks :

public static class notes implements notescolumns, basecolumns {     public static final uri content_uri =             base_content_uri.buildupon().appendpath(path_notes).build();     public static final uri content_export_uri =             content_uri.buildupon().appendpath(path_export).build();      /** {@link sessions#session_id} note references. */     public static final string session_id = "session_id";      /** default "order by" clause. */     public static final string default_sort = notescolumns.note_time + " desc";      public static final string content_type =             "vnd.android.cursor.dir/vnd.iosched.note";     public static final string content_item_type =             "vnd.android.cursor.item/vnd.iosched.note";      public static uri buildnoteuri(long noteid) {         return contenturis.withappendedid(content_uri, noteid);     }      public static long getnoteid(uri uri) {         return contenturis.parseid(uri);     } } 

i cant see code do, , how ends starting notesactivity notes loaded in. dont understand how , uri used second parameter in new :
intent(intent.action_view, notes.content_uri).
searched on google explanation failed find simple 1 , simple examples. guess notes class used point , format data (notes) , somehow notesactivity started, dont understand how.

in android never launch specific application, @ least not directly. do, create intent, an abstract description of operation performed:

an intent provides facility performing late runtime binding between code in different applications. significant use in launching of activities, can thought of glue between activities. passive data structure holding abstract description of action performed. primary pieces of information in intent are:

whenever want launch application, send text message, pick contact, activate camera etc, create , start intent, , android figures out application should launch.

so example notes activity:

startactivity(new intent(intent.action_view, notes.content_uri)); 

the first parameter, intent.action_view, tells intetwill display user. second parameter, notes.content_uri, uniform resource identifier notes activity (in example, uri can include id if want open activity specific note). result notes activity displayed user.

if need more information, suggest reading android application fundamentals , intents , intent filters, explain these concepts in detail


Comments

Popular posts from this blog

android - Spacing between the stars of a rating bar? -

aspxgridview - Devexpress grid - header filter does not work if column is initially hidden -

c# - How to execute a particular part of code asynchronously in a class -