SHARE
TWEET

Untitled

a guest Nov 1st, 2013 194 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. abstract class EntityActivity extends Activity{
  2.         @Override
  3.         public void onCreate(Bundle savedInstanceState) {
  4.                 super.onCreate(savedInstanceState);
  5.  
  6.                 if (isOnline()) {
  7.                         doSomethingWhereWeAreOnline();
  8.                 } else {
  9.                         offlineRun(getClass());
  10.                 }
  11.         }
  12.  
  13.         protected abstract void doSomethingWhereWeAreOnline();
  14. }
  15.  
  16. class MyActivity extends EntityActivity {
  17.         @Override
  18.         protected void doSomethingWhereWeAreOnline() {
  19.                 setContentView(R.layout.main);
  20.         }
  21. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top