Ignore:
Timestamp:
Dec 14, 2013 1:14:07 AM (10 years ago)
Author:
nanang
Message:

Re #1716: Handle recreated activity, for example by device rotation.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/branches/projects/pjsua2/pjsip-apps/src/swig/java/android/src/org/pjsip/pjsua2/app/MainActivity.java

    r4691 r4693  
    4444 
    4545public class MainActivity extends Activity implements Handler.Callback, MyAppObserver { 
    46         public static MyApp app = new MyApp(); 
     46        public static MyApp app = null; 
    4747        public static MyCall currentCall = null; 
    4848        public static MyAccount account = null; 
     
    8181                setContentView(R.layout.activity_main); 
    8282                 
    83             app.init(this, getFilesDir().getAbsolutePath()); 
     83                if (app == null) { 
     84                        app = new MyApp(); 
     85                    app.init(this, getFilesDir().getAbsolutePath()); 
     86                } 
     87                 
    8488            if (app.accList.size() == 0) { 
    8589                accCfg = new AccountConfig(); 
     
    177181                                //buddyListView.performItemClick(buddyListView, buddyListSelectedIdx, 
    178182                                //                                                         buddyListView.getItemIdAtPosition(buddyListSelectedIdx)); 
     183                                 
     184                                /* Return back Call activity */ 
     185                                notifyCallState(currentCall); 
    179186                        } 
    180187                         
Note: See TracChangeset for help on using the changeset viewer.