57 lines
2.2 KiB
Java
57 lines
2.2 KiB
Java
package cn.com.magnity.magnitycx;
|
|
|
|
import android.os.Bundle;
|
|
import android.support.v4.app.Fragment;
|
|
import android.support.v4.app.FragmentManager;
|
|
import android.support.v7.app.ActionBar;
|
|
import android.support.v7.app.AppCompatActivity;
|
|
import android.view.MenuItem;
|
|
import com.baidu.mobstat.StatService;
|
|
|
|
/* loaded from: classes.dex */
|
|
public class SupportActivity extends AppCompatActivity {
|
|
@Override // android.support.v7.app.AppCompatActivity, android.support.v4.app.FragmentActivity, android.support.v4.app.BaseFragmentActivityGingerbread, android.app.Activity
|
|
protected void onCreate(Bundle savedInstanceState) {
|
|
super.onCreate(savedInstanceState);
|
|
setContentView(R.layout.activity_support);
|
|
ActionBar actionBar = getSupportActionBar();
|
|
actionBar.setHomeButtonEnabled(true);
|
|
actionBar.setDisplayHomeAsUpEnabled(true);
|
|
FragmentManager fm = getSupportFragmentManager();
|
|
Fragment fragment = fm.findFragmentById(R.id.id_space_fragment_setting);
|
|
if (fragment == null) {
|
|
getSupportFragmentManager().beginTransaction().add(R.id.id_space_fragment, new FragmentSupport()).commit();
|
|
}
|
|
}
|
|
|
|
@Override // android.support.v7.app.AppCompatActivity, android.support.v4.app.FragmentActivity, android.app.Activity
|
|
protected void onPostResume() {
|
|
super.onPostResume();
|
|
StatService.onResume(this);
|
|
}
|
|
|
|
@Override // android.support.v4.app.FragmentActivity, android.app.Activity
|
|
protected void onPause() {
|
|
super.onPause();
|
|
StatService.onPause(this);
|
|
}
|
|
|
|
public void showHelp() {
|
|
getSupportFragmentManager().beginTransaction().addToBackStack(null).replace(R.id.id_space_fragment, new FragmentSupportHelp()).commit();
|
|
}
|
|
|
|
public void showAbout() {
|
|
getSupportFragmentManager().beginTransaction().addToBackStack(null).replace(R.id.id_space_fragment, new FragmentSupportAbout()).commit();
|
|
}
|
|
|
|
@Override // android.app.Activity
|
|
public boolean onOptionsItemSelected(MenuItem item) {
|
|
switch (item.getItemId()) {
|
|
case android.R.id.home:
|
|
super.onBackPressed();
|
|
break;
|
|
}
|
|
return super.onOptionsItemSelected(item);
|
|
}
|
|
}
|