//1 、这部分是创建一个悬浮窗口,添加到 WindowManager
this.floatView = new FloatView();
this.mWindowManager.addView(this.mElfinFloatView,this.mElfinFloatView.getLayoutParams());
//2 、悬浮窗口类继承 LinearLayout,
public class FloatView extends LinearLayout implements OnClickListener
{
......
//这里新建另一个继承 DialogFragment 的浮窗类
FragmentPage mdf = new FragmentPage();
FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
ft.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_FADE);
mdf.show(ft, "df");
//getSupportFragmentManager()是活动 Activity 里才有的方法。
//但是这个类没有 Activity,怎办啊
//从其他窗口传 Activity 过来行不通,原来 Activity 销毁,传过来就没用了
......
}
谁有什么办法能解决吗??
this.floatView = new FloatView();
this.mWindowManager.addView(this.mElfinFloatView,this.mElfinFloatView.getLayoutParams());
//2 、悬浮窗口类继承 LinearLayout,
public class FloatView extends LinearLayout implements OnClickListener
{
......
//这里新建另一个继承 DialogFragment 的浮窗类
FragmentPage mdf = new FragmentPage();
FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
ft.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_FADE);
mdf.show(ft, "df");
//getSupportFragmentManager()是活动 Activity 里才有的方法。
//但是这个类没有 Activity,怎办啊
//从其他窗口传 Activity 过来行不通,原来 Activity 销毁,传过来就没用了
......
}
谁有什么办法能解决吗??