89 lines
3.3 KiB
Java
89 lines
3.3 KiB
Java
package com.gh.gamecenter;
|
|
|
|
import android.content.Context;
|
|
import android.content.Intent;
|
|
import android.os.Bundle;
|
|
|
|
import com.gh.base.fragment.BaseFragment_TabLayout;
|
|
import com.gh.common.util.EntranceUtils;
|
|
import com.gh.gamecenter.download.DownloadFragment;
|
|
|
|
/**
|
|
* 下载更新管理页面
|
|
*
|
|
* @author 黄壮华
|
|
*/
|
|
public class DownloadManagerActivity extends NormalActivity {
|
|
|
|
public static final int INDEX_DOWNLOAD = 0;
|
|
public static final int INDEX_UPDATE = 1;
|
|
public static final int INDEX_SEND = 2;
|
|
|
|
public static final String TAG = "DownloadManagerActivity";
|
|
|
|
@Override
|
|
protected Intent provideNormalIntent() {
|
|
return getTargetIntent(this, DownloadManagerActivity.class, DownloadFragment.class);
|
|
}
|
|
|
|
public static Intent getDownloadMangerIntent(Context context, String url, String entrance) {
|
|
// Intent intent = new Intent(context, DownloadManagerActivity.class);
|
|
// intent.putExtra(EntranceUtils.KEY_URL, url);
|
|
// intent.putExtra(EntranceUtils.KEY_ENTRANCE, entrance);
|
|
Bundle bundle = new Bundle();
|
|
bundle.putString(EntranceUtils.KEY_URL, url);
|
|
bundle.putString(EntranceUtils.KEY_ENTRANCE, entrance);
|
|
return getTargetIntent(context, DownloadManagerActivity.class, DownloadFragment.class, bundle);
|
|
}
|
|
|
|
public static Intent getDownloadMangerIntent(Context context, int position, String entrance) {
|
|
// Intent intent = new Intent(context, DownloadManagerActivity.class);
|
|
// intent.putExtra(EntranceUtils.KEY_URL, url);
|
|
// intent.putExtra(EntranceUtils.KEY_ENTRANCE, entrance);
|
|
Bundle bundle = new Bundle();
|
|
bundle.putString(EntranceUtils.KEY_ENTRANCE, entrance);
|
|
bundle.putInt(BaseFragment_TabLayout.PAGE_INDEX, position);
|
|
return getTargetIntent(context, DownloadManagerActivity.class, DownloadFragment.class, bundle);
|
|
}
|
|
|
|
|
|
// public static void startDownloadManagerActivity(Context context, String url, String entrance) {
|
|
// Intent intent = new Intent(context, DownloadManagerActivity.class);
|
|
// intent.putExtra(EntranceUtils.KEY_URL, url);
|
|
// intent.putExtra(EntranceUtils.KEY_ENTRANCE, entrance);
|
|
// intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
|
// context.startActivity(intent);
|
|
// }
|
|
//
|
|
// @Override
|
|
// protected int getLayoutId() {
|
|
// return R.layout.activity_downloadmanager;
|
|
// }
|
|
|
|
// @Override
|
|
// protected void onCreate(Bundle savedInstanceState) {
|
|
// super.onCreate(savedInstanceState);
|
|
//
|
|
// setNavigationTitle(getString(R.string.title_downloadmanager));
|
|
//
|
|
// startDownloadFragment();
|
|
// }
|
|
//
|
|
// private void startDownloadFragment() {
|
|
// int currentItem = getIntent().getIntExtra(EntranceUtils.KEY_CURRENTITEM, 0);
|
|
// Bundle data = getIntent().getBundleExtra(EntranceUtils.KEY_DATA);
|
|
// if (data != null) {
|
|
// currentItem = data.getInt(EntranceUtils.KEY_CURRENTITEM, 0);
|
|
// }
|
|
//
|
|
// getSupportFragmentManager().beginTransaction().replace(
|
|
// R.id.layout_fragment_content, DownloadFragment.newInstance(currentItem)).commitAllowingStateLoss();
|
|
// }
|
|
//
|
|
// @Override
|
|
// protected void onNewIntent(Intent intent) {
|
|
// super.onNewIntent(intent);
|
|
// startDownloadFragment();
|
|
// setIntent(intent);
|
|
// }
|
|
} |