Show frequently used intents on top
This commit is contained in:
@@ -19,13 +19,14 @@ import java.net.URLEncoder;
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class ShareActivity extends FragmentActivity implements ActionBar.TabListener {
|
||||
private IntentComparator mComparator;
|
||||
private IntentFragmentAdapter mFragmentAdapter;
|
||||
private boolean mIsPortal;
|
||||
private String mLl;
|
||||
private SharedPreferences mSharedPrefs = null;
|
||||
private String mTitle;
|
||||
private ViewPager mViewPager;
|
||||
private int mZoom;
|
||||
IntentFragmentAdapter mFragmentAdapter;
|
||||
ViewPager mViewPager;
|
||||
|
||||
private void addTab(ArrayList<Intent> intents, int label, int icon) {
|
||||
IntentFragment fragment = new IntentFragment();
|
||||
@@ -53,9 +54,7 @@ public class ShareActivity extends FragmentActivity implements ActionBar.TabList
|
||||
|
||||
private void setSelected(int position) {
|
||||
// Activity not fully loaded yet (may occur during tab creation)
|
||||
if (mSharedPrefs == null) {
|
||||
return;
|
||||
}
|
||||
if (mSharedPrefs == null) { return; }
|
||||
|
||||
mSharedPrefs
|
||||
.edit()
|
||||
@@ -102,6 +101,8 @@ public class ShareActivity extends FragmentActivity implements ActionBar.TabList
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_share);
|
||||
|
||||
mComparator = new IntentComparator(this);
|
||||
|
||||
mFragmentAdapter = new IntentFragmentAdapter(getSupportFragmentManager());
|
||||
|
||||
final ActionBar actionBar = getActionBar();
|
||||
@@ -158,6 +159,16 @@ public class ShareActivity extends FragmentActivity implements ActionBar.TabList
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
super.onDestroy();
|
||||
mComparator.save();
|
||||
}
|
||||
|
||||
public IntentComparator getIntentComparator() {
|
||||
return mComparator;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onOptionsItemSelected(MenuItem item) {
|
||||
switch (item.getItemId()) {
|
||||
|
Reference in New Issue
Block a user