2

私は、電話をかけたり受けたりするためのSipベースのアプリケーションを開発しました。また、このアプリにはチャット機能も含まれています。

私のアプリケーションは、Samsung Galaxy y と Sony Ericsson の ICS バージョンで正常に動作します。しかし、Samsung Galaxy S2でアプリケーションを使用している間、ユーザーは登録されません。アスタリスクで間違ったパスワードエラーが表示されます。

つまり、sharedpreferences から値を取得できないか、デバイスに値を保存できません。

4

2 に答える 2

0

@juned、コードを見ると、特別なことは何もありません。とにかく、sharedPref に関係するコードの一部を次に示します。

SharedPref の設定

    SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(this);
    final SharedPreferences.Editor editor = preferences.edit();
    editor.putFloat("longitude", (float)location.getLongitude());
    editor.putFloat("latitude", (float)location.getLatitude());
    editor.commit();

そしてフェッチ

    sharedPreferences = PreferenceManager.getDefaultSharedPreferences(this);
    GeoPoint userLocationPoint = new GeoPoint((int) (sharedPreferences.getFloat("latitude", (float) 0.0) * 1E6),
            (int) (sharedPreferences.getFloat("longitude", (float) 0.0) * 1E6));
于 2012-06-04T18:23:28.013 に答える