當前位置: 首頁>>代碼示例>>Java>>正文


Java ParseUser.getCurrentUser方法代碼示例

本文整理匯總了Java中com.parse.ParseUser.getCurrentUser方法的典型用法代碼示例。如果您正苦於以下問題:Java ParseUser.getCurrentUser方法的具體用法?Java ParseUser.getCurrentUser怎麽用?Java ParseUser.getCurrentUser使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.parse.ParseUser的用法示例。


在下文中一共展示了ParseUser.getCurrentUser方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: onCreate

import com.parse.ParseUser; //導入方法依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_login);

    Button verifyPhoneLogin = (Button) findViewById(R.id.start_phone_login);
    verifyPhoneLogin.setOnClickListener(new OnClickListener() {
        @Override
        public void onClick(View view) {
            onPhoneLogin();
        }
    });

    loginFormView = findViewById(R.id.login_form);
    progressView = findViewById(R.id.login_progress);

    // Log out any existing session
    ParseUser currentUser = ParseUser.getCurrentUser();
    if (currentUser != null) {
        ParseUser.logOut();
    }
}
 
開發者ID:oscarb,項目名稱:flowlist,代碼行數:23,代碼來源:LoginActivity.java

示例2: onCreate

import com.parse.ParseUser; //導入方法依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    ViewPager vpPager = (ViewPager) findViewById(R.id.vpPager);
    adapterViewPager = new MyPagerAdapter(getSupportFragmentManager(),getApplicationContext());
    vpPager.setAdapter(adapterViewPager);
    ParseUser currentUser = ParseUser.getCurrentUser();
    if (ParseAnonymousUtils.isLinked(currentUser) || currentUser==null) {
        // If user is anonymous, send the user to LoginSignupActivity.class
        Intent intent = new Intent(HomeActivity.this,
                LoginSignupActivity.class);
        startActivity(intent);
        finish();

    }
}
 
開發者ID:safakesberk,項目名稱:Cloud_Base-To-Do-App,代碼行數:18,代碼來源:HomeActivity.java

示例3: onSnackListUpdateComplete

import com.parse.ParseUser; //導入方法依賴的package包/類
@Override
public void onSnackListUpdateComplete(ParseException e) {
    // Start the login activity if the session token is invalid.
    if(e != null && e.getCode() == ParseException.INVALID_SESSION_TOKEN){
        if(myActivity != null){
            Intent startLoginIntent = new Intent(myActivity, LoginActivity.class);
            ParseUser.logOutInBackground();
            myActivity.finish();
            startActivity(startLoginIntent);
        }
    }

    adapter.notifyDataSetChanged();

    if(progressOverlay != null){
        progressOverlay.setVisibility(View.GONE);
    }

    // Show the help message if appropriate.
    // That is, if we haven't already showed it for the current user this session and the
    // current user has zero entries. Only show the help message if the SnackList is pointing
    // at the current user.
    if(lastShowedHelpFor != ParseUser.getCurrentUser()
            && !showingHelp && SnackList.getInstance().size() == 0
            && ParseUser.getCurrentUser().equals(SnackList.getInstance().getUser())){
        try{
            showHelpMessage();
        } catch(IllegalStateException ignored){
            // In the case that onSaveInstanceState has been already been called, we ignore
            // the exception.
        }
    }
}
 
開發者ID:SCCapstone,項目名稱:diet,代碼行數:34,代碼來源:PreviousEntriesFragment.java

示例4: onCreate

import com.parse.ParseUser; //導入方法依賴的package包/類
@Override protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_home);
        ButterKnife.bind(this);
        Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
        setSupportActionBar(toolbar);

        if (ParseUser.getCurrentUser() != null) {
            getSelectedChannel();

            Log.e(LOG_TAG, "User is already logged in: " + ParseUser.getCurrentUser().get(Constants.PARSE_USER_ATTR_NAME));
//            showFeed();
        } else {
            retrieveChannels();
            Log.e(LOG_TAG, "User not logged in");

        }

    }
 
開發者ID:dougritter,項目名稱:mirante,代碼行數:20,代碼來源:HomeActivity.java

示例5: initChangePass

import com.parse.ParseUser; //導入方法依賴的package包/類
public void initChangePass(final View v) {

        if (mPasswordField.getText().length() == 0) {
            mPasswordField.setText("Password can't be empty!");
            return;
        }
        v.setEnabled(false);
        spinner.setVisibility(View.VISIBLE);
        mErrorField.setText("");
        InputMethodManager mgr = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
        mgr.hideSoftInputFromWindow(mPasswordField.getWindowToken(), 0);
        ParseUser curUser = ParseUser.getCurrentUser();
        curUser.setPassword(mPasswordField.getText().toString());
        curUser.saveInBackground();
        spinner.setVisibility(View.GONE);
    }
 
開發者ID:bhavyanshu,項目名稱:TemplateAppParse-dot-com,代碼行數:17,代碼來源:ChangePassActivity.java

示例6: verificarUsuarioLogado

import com.parse.ParseUser; //導入方法依賴的package包/類
private void verificarUsuarioLogado() {

        if (ParseUser.getCurrentUser() != null) {
            //Enviar usuário para tela principal do App
            abrirAreaPrincipal();
            finish();
        }

    }
 
開發者ID:FilipeAlbuquerque,項目名稱:EletroFisio,代碼行數:10,代碼來源:LoginActivity.java

示例7: installupdate

import com.parse.ParseUser; //導入方法依賴的package包/類
private void installupdate() {
    ParseInstallation pinst = ParseInstallation.getCurrentInstallation();
    ParseUser puser = ParseUser.getCurrentUser();
    if (puser != null) {
        pinst.put("username", puser.getUsername());
        pinst.saveInBackground();
    }
}
 
開發者ID:salRoid,項目名稱:Clasick,代碼行數:9,代碼來源:MainActivity.java

示例8: onCreate

import com.parse.ParseUser; //導入方法依賴的package包/類
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    if (getArguments() != null) {
        mCourse = getArguments().getString(ARG_COURSE);
        mLabCount = getArguments().getInt(ARG_LAB_COUNT);
    }

    labtech = ParseUser.getCurrentUser();
    setRetainInstance(true);
}
 
開發者ID:JavonDavis,項目名稱:Lab-Assistant,代碼行數:12,代碼來源:GradeFragment.java

示例9: onCreate

import com.parse.ParseUser; //導入方法依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_login);

    getSupportFragmentManager().beginTransaction()
            .add(R.id.container,LoginFragment.newInstance())
            .commit();

    ParseUser currentUser = ParseUser.getCurrentUser();
    if (currentUser != null) {
        onLoginSuccessful();
    }
}
 
開發者ID:JavonDavis,項目名稱:Lab-Assistant,代碼行數:15,代碼來源:LoginActivity.java

示例10: onSharedPreferenceChanged

import com.parse.ParseUser; //導入方法依賴的package包/類
@Override
public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) {
    if (key.equals("pref_distance")) {
        Preference pref = findPreference(key);
        pref.setSummary(sharedPreferences.getString(key, ""));
        ParseUser pu = ParseUser.getCurrentUser();
        Log.d("SETTINGS", sharedPreferences.getString(key, "100"));
        pu.put("distance", Float.parseFloat(sharedPreferences.getString(key, "100"))/1000.0);
        pu.saveEventually();
    }
}
 
開發者ID:AvijitGhosh82,項目名稱:Madad_SOS,代碼行數:12,代碼來源:SettingsFragment.java

示例11: onStartCommand

import com.parse.ParseUser; //導入方法依賴的package包/類
@Override
public int onStartCommand(Intent intent, int flags, int startId) {
    super.onStartCommand(intent, flags, startId);

    Log.e("Network Loc Service", "Service running");
    AlarmManager am = (AlarmManager)getSystemService(Context.ALARM_SERVICE);


    Calendar timeOff9 = Calendar.getInstance();

    Intent intent2 = new Intent(this,MyReceiver.class);

    PendingIntent sender = PendingIntent.getBroadcast(this, 0, intent2,
            PendingIntent.FLAG_UPDATE_CURRENT);

    am.set(AlarmManager.RTC_WAKEUP, timeOff9.getTimeInMillis() + 55000, sender);
    ParseGeoPoint pt = new ParseGeoPoint(getLocation().getLatitude(),getLocation().getLongitude());
    ParseUser person = ParseUser.getCurrentUser();
    if(person==null)
    {
        stopSelf();
        return 0;
    }
    person.put("Geolocation",pt);
    person.saveInBackground();
    return START_STICKY;
}
 
開發者ID:AvijitGhosh82,項目名稱:Madad_SOS,代碼行數:28,代碼來源:NetworkLocationService.java

示例12: onCreate

import com.parse.ParseUser; //導入方法依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    // Check if user is logged in
    ParseUser currentUser = ParseUser.getCurrentUser();
    if (currentUser == null) {
        launchLoginActivity();
    }

    setContentView(R.layout.activity_main);
    Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
    setSupportActionBar(toolbar);
}
 
開發者ID:oscarb,項目名稱:flowlist,代碼行數:15,代碼來源:MainActivity.java

示例13: run

import com.parse.ParseUser; //導入方法依賴的package包/類
@Override
public void run() {
    try {
        mSocket = new Socket(mHost, mPort);
        mOut = new OutputStreamWriter(mSocket.getOutputStream());
        mIn = new BufferedReader(new InputStreamReader(mSocket.getInputStream()));
        Log.d(TAG, "Connected to socket notification server");
        // Send subscription request
        if (ParseUser.getCurrentUser() != null) {
            final String id = ParseUser.getCurrentUser().getObjectId();
            mOut.write("{\"type\":\"register\", \"value\":\"" + id + "\"}");
            mOut.flush();
        }
        // Start listening for notifications
        while (true) {
            final String data = mIn.readLine();
            if (data == null) {
                throw new IOException("Socket dropped?");
            }
            JSONObject json = new JSONObject(data);
            onNotification(json);
            Log.d(TAG, "Received data from notification server: " + data);
        }
    }
    catch (Exception e) {
        Log.e(TAG, "Exception on socket thread", e);
        cleanup();
        scheduleRestart();
    }
    Log.d(TAG, "Socket notification thread stopping");
}
 
開發者ID:badoo,項目名稱:Chateau,代碼行數:32,代碼來源:SocketNotificationClient.java

示例14: onCreate

import com.parse.ParseUser; //導入方法依賴的package包/類
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    if (ParseUser.getCurrentUser() != null) {
        openConversationsList();
    }
    else {
        openLogin();
    }
    finish();
}
 
開發者ID:badoo,項目名稱:Chateau,代碼行數:13,代碼來源:LandingActivity.java

示例15: signOutFromGplus

import com.parse.ParseUser; //導入方法依賴的package包/類
/**
 * Sign-out from google
 * */
public void signOutFromGplus() {
    if (mGoogleApiClient.isConnected()) {
        if(ParseUser.getCurrentUser() != null){
            ParseUser.logOut();
        }
        Plus.AccountApi.clearDefaultAccount(mGoogleApiClient);
        mGoogleApiClient.disconnect();
        mGoogleApiClient.connect();
        updateUI(false);
    }
}
 
開發者ID:cfudge,項目名稱:ClassDiscuss,代碼行數:15,代碼來源:MainActivity.java


注:本文中的com.parse.ParseUser.getCurrentUser方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。