为所有页面添加Activity(为了接入MTA页面访问统计)
This commit is contained in:
@ -1,6 +1,5 @@
|
||||
package com.gh.gamecenter;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
@ -25,7 +24,7 @@ import butterknife.BindView;
|
||||
* Created by khy on 17/10/17.
|
||||
*/
|
||||
|
||||
public class NormalActivity extends BaseActivity implements ToolbarController, Toolbar.OnMenuItemClickListener {
|
||||
public abstract class NormalActivity extends BaseActivity implements ToolbarController, Toolbar.OnMenuItemClickListener {
|
||||
|
||||
@BindView(R.id.normal_toolbar)
|
||||
Toolbar mNormalToolbar;
|
||||
@ -49,21 +48,21 @@ public class NormalActivity extends BaseActivity implements ToolbarController, T
|
||||
return intent;
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
protected static Intent getIntent(Context context, Class<? extends NormalFragment> t, Bundle bundle) {
|
||||
Intent intent = new Intent(context, NormalActivity.class);
|
||||
|
||||
protected static Intent getTargetIntent(Context context, Class<? extends NormalActivity> cls, Class<? extends NormalFragment> t, Bundle bundle) {
|
||||
Intent intent = new Intent(context, cls);
|
||||
intent.putExtra(NORMAL_FRAGMENT_NAME, t.getCanonicalName());
|
||||
intent.putExtra(NORMAL_FRAGMENT_BUNDLE, bundle);
|
||||
return intent;
|
||||
}
|
||||
|
||||
|
||||
public static void startFragment(Context context, Class<? extends NormalFragment> t) {
|
||||
Intent intent = new Intent(context, NormalActivity.class);
|
||||
protected static Intent getTargetIntent(Context context, Class<? extends NormalActivity> cls, Class<? extends NormalFragment> t) {
|
||||
Intent intent = new Intent(context, cls);
|
||||
intent.putExtra(NORMAL_FRAGMENT_NAME, t.getCanonicalName());
|
||||
context.startActivity(intent);
|
||||
return intent;
|
||||
}
|
||||
|
||||
|
||||
public static void startFragmentNewTask(Context context, Class<? extends NormalFragment> t, Bundle bundle) {
|
||||
Intent intent = new Intent(context, NormalActivity.class);
|
||||
intent.putExtra(NORMAL_FRAGMENT_NAME, t.getCanonicalName());
|
||||
@ -79,22 +78,6 @@ public class NormalActivity extends BaseActivity implements ToolbarController, T
|
||||
context.startActivity(intent);
|
||||
}
|
||||
|
||||
public static void startFragmentForResult(Context context, Class<? extends NormalFragment> t, int requestCode) {
|
||||
Intent intent = new Intent(context, NormalActivity.class);
|
||||
intent.putExtra(NORMAL_FRAGMENT_NAME, t.getCanonicalName());
|
||||
if (context instanceof Activity) {
|
||||
((Activity) context).startActivityForResult(intent, requestCode);
|
||||
}
|
||||
}
|
||||
|
||||
public static void startFragmentForResult(Context context, Class<? extends NormalFragment> t, Bundle bundle, int requestCode) {
|
||||
Intent intent = new Intent(context, NormalActivity.class);
|
||||
intent.putExtra(NORMAL_FRAGMENT_NAME, t.getCanonicalName());
|
||||
intent.putExtra(NORMAL_FRAGMENT_BUNDLE, bundle);
|
||||
if (context instanceof Activity) {
|
||||
((Activity) context).startActivityForResult(intent, requestCode);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user