We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
package com.android.activity; import android.os.Bundle; import android.support.v4.app.Fragment; import android.support.v4.app.FragmentActivity; import android.widget.ImageView; import android.widget.TextView; import com.android.fragment.MenuFragment; //import com.special.ResideMenu.ResideMenu; //import com.special.ResideMenu.ResideMenuInfo; //import com.special.ResideMenu.ResideMenuItem; public class MainActivity extends FragmentActivity { public Fragment mContent; public TextView maintitle; public ImageView logo; private MenuFragment fragment; MyApplication myApp; /** * Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); maintitle = (TextView) findViewById(R.id.main_txt); logo = (ImageView) findViewById(R.id.logo); myApp = (MyApplication) getApplication(); // changeFragment(new HuDongFragment()); initView();// 初始化页面信息 } // 监听手机上的BACK键 //public boolean onKeyDown(int keyCode, KeyEvent event) { // if (keyCode == KeyEvent.KEYCODE_BACK) { // // 判断菜单是否关闭 // if (is_closed) { // // 判断两次点击的时间间隔(默认设置为2秒)ime) > 2000) { // Toast.makeText(this, "再按一次退出程 // if ((System.currentTimeMillis() - mExitT序", Toast.LENGTH_SHORT).show(); // mExitTime = System.currentTimeMillis(); // } else { // finish(); // System.exit(0); // super.onBackPressed(); // } // } else { // resideMenu.closeMenu(); // } // return true; // } // return super.onKeyDown(keyCode, event); //} private void initView() { maintitle.setText("今日签到"); fragment = new MenuFragment(); mContent = fragment; // 显示主页面 getSupportFragmentManager().beginTransaction() .replace(R.id.content_frame, mContent).commit(); } public void switchContent(Fragment fragment) { fragment.getClass().getSimpleName() == fragment.getClass().getSimpleName() mContent = fragment; getSupportFragmentManager().beginTransaction() .replace(R.id.content_frame, fragment).commit(); } @Override public void onBackPressed() { switchContent(fragment); // super.onBackPressed(); } }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
The text was updated successfully, but these errors were encountered: