Fixed share feature
This commit is contained in:
parent
aa5eab7743
commit
217c0f431f
1 changed files with 18 additions and 3 deletions
|
|
@ -63,11 +63,12 @@ public class MainActivity extends AppCompatActivity{
|
||||||
setContentView(R.layout.activity_main);
|
setContentView(R.layout.activity_main);
|
||||||
setContentView(binding.getRoot());
|
setContentView(binding.getRoot());
|
||||||
|
|
||||||
|
fm = getSupportFragmentManager();
|
||||||
|
|
||||||
homeFragment = new HomeFragment();
|
homeFragment = new HomeFragment();
|
||||||
historyFragment = new HistoryFragment();
|
historyFragment = new HistoryFragment();
|
||||||
settingsFragment = new SettingsFragment();
|
settingsFragment = new SettingsFragment();
|
||||||
|
|
||||||
fm = getSupportFragmentManager();
|
|
||||||
fm.beginTransaction()
|
fm.beginTransaction()
|
||||||
.replace(R.id.frame_layout, homeFragment)
|
.replace(R.id.frame_layout, homeFragment)
|
||||||
.add(R.id.frame_layout, historyFragment)
|
.add(R.id.frame_layout, historyFragment)
|
||||||
|
|
@ -107,10 +108,24 @@ public class MainActivity extends AppCompatActivity{
|
||||||
|
|
||||||
public void handleIntents(Intent intent){
|
public void handleIntents(Intent intent){
|
||||||
String action = intent.getAction();
|
String action = intent.getAction();
|
||||||
Log.e(TAG, action);
|
|
||||||
if(Intent.ACTION_SEND.equals(action)){
|
if(Intent.ACTION_SEND.equals(action)){
|
||||||
|
Log.e(TAG, action);
|
||||||
|
|
||||||
|
|
||||||
|
homeFragment = new HomeFragment();
|
||||||
|
historyFragment = new HistoryFragment();
|
||||||
|
settingsFragment = new SettingsFragment();
|
||||||
|
|
||||||
homeFragment.handleIntent(intent);
|
homeFragment.handleIntent(intent);
|
||||||
replaceFragment(homeFragment);
|
fm.beginTransaction()
|
||||||
|
.replace(R.id.frame_layout, homeFragment)
|
||||||
|
.add(R.id.frame_layout, historyFragment)
|
||||||
|
.add(R.id.frame_layout, settingsFragment)
|
||||||
|
.hide(historyFragment)
|
||||||
|
.hide(settingsFragment)
|
||||||
|
.commit();
|
||||||
|
|
||||||
|
lastFragment = homeFragment;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue