相关疑难解决方法(0)

如何在Android中使用SharedPreferences来存储,获取和编辑值

我想存储一个时间值,需要检索和编辑它.我SharedPreferences该怎么用呢?

android sharedpreferences

599
推荐指数
20
解决办法
62万
查看次数

保存有关Facebook用户的信息,以便在另一个Activity中使用

我正在为我的大学做项目,我想知道如何保存关于facebook用户的一些信息,如姓名,电子邮件和图片.那么我如何在另一个Activity中使用这些信息呢?正如你可以看到我的代码,我可以在我记录的同一活动中显示信息,但我不能在另一个活动中

MainActivity.java

public class MainActivity extends ActionBarActivity {

public static final int INDEX_SIMPLE_LOGIN = 0;
public static final int INDEX_CUSTOM_LOGIN = 1;

private static final String STATE_SELECTED_FRAGMENT_INDEX = "selected_fragment_index";
public static final String FRAGMENT_TAG = "fragment_tag";
private FragmentManager mFragmentManager;

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    mFragmentManager = getSupportFragmentManager();

}

@Override
public void onSaveInstanceState(Bundle outState) {
    super.onSaveInstanceState(outState);
}

@Override
public boolean onCreateOptionsMenu(Menu menu) {
    // Inflate the menu; this adds items to the action bar if it is present. …
Run Code Online (Sandbox Code Playgroud)

android facebook facebook-sdk-4.0

5
推荐指数
1
解决办法
2986
查看次数