Пример #1
0
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.alubumlistview);
    alubumlistview = (ListView) findViewById(R.id.alubumlistview);
    imagegallerytextview = (TextView) findViewById(R.id.imagegallerytextview);
    Ultilities mUltilities = new Ultilities();
    int imageHeightAndWidht[] = mUltilities.getImageHeightAndWidthForAlubumListview(this);
    alubumList = new ArrayList<ListviewAlubumData>();
    mAlubumListViewAdapter = new AlubumListViewAdapter(this, alubumList, imageHeightAndWidht);
    alubumlistview.setAdapter(mAlubumListViewAdapter);
    imagegallerytextview.setText("Albums");
    Typeface HelveticaLTStd_Light =
        Typeface.createFromAsset(getAssets(), "fonts/HelveticaLTStd-Light.otf");
    imagegallerytextview.setTypeface(HelveticaLTStd_Light);
    imagegallerytextview.setTextColor(Color.rgb(255, 255, 255));
    imagegallerytextview.setTextSize(20);
    Settings.addLoggingBehavior(LoggingBehavior.INCLUDE_ACCESS_TOKENS);
    Session session = Session.getActiveSession();

    logDebug("onCreate session " + session);
    if (session == null) { // logDebug("onCreate savedInstanceState "+savedInstanceState);
      if (savedInstanceState != null) {
        session = Session.restoreSession(this, null, statusCallback, savedInstanceState);
        // logDebug("onCreate savedInstanceState restore session   "+session);
      }
      if (session == null) {
        session = new Session(this);
        // logDebug("onCreate savedInstanceState create session   "+session);
      }
      Session.setActiveSession(session);
      // logDebug("onCreate savedInstanceState state session    "+session.getState());
      if (session.getState().equals(SessionState.CREATED_TOKEN_LOADED)) {
        // session.openForRead(new
        // Session.OpenRequest(this).setPermissions(Arrays.asList("user_birthday",
        // "email","user_relationships","user_photos")).setCallback(statusCallback));
      }
    }

    try {
      if (session.isOpened()) {
        getUserAllAlubum();
      } else {
        getOpenedSession();
      }
      alubumlistview.setOnItemClickListener(this);
      ;

    } catch (Exception e) {
      logError("error onCreate Exception " + e);
    }
  }
Пример #2
0
 @Override
 protected void onPreExecute() {
   super.onPreExecute();
   mdialog = mUltilities.GetProcessDialog(AlbumListView.this);
   mdialog.setCancelable(false);
   mdialog.show();
 }