PhoneGap中文网

标题: phonegap里的activity如何跳到html页面? [打印本页]

作者: cmaster    时间: 2015-3-19 15:56
标题: phonegap里的activity如何跳到html页面?
在phonegap项目里通过插件的方式调用一个activity,在这个在activity界面有一个链接,通过监听onClick方法跳转到项目里的login页面,现在的处理方法是
在onclick里方法里跳转到另外一个activity,在这个activity里执行这些代码:public void onCreate(Bundle savedInstanceState) {
                super.onCreate(savedInstanceState);
                //this.appView.setBackgroundResource(R.drawable.screen);
                super.setIntegerProperty("splashscreen",R.drawable.screen );
                this.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN);
                super.loadUrl("file:///android_asset/www/html/login.html",2000);       
        }
跳转到html页面,跳转可以成功,问题是login页面点击登录失效页面显示也不正常头部颜色不对,推测的原因是项目里有一个配置为启动的主activity影响了:
<activity android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale" android:label="@string/app_name" android:launchMode="singleTop" android:name="Test" android:theme="@android:style/Theme.Black.NoTitleBar" android:windowSoftInputMode="adjustPan">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>

        </activity>

有啥好办法解决吗

作者: 跨平台移动开发    时间: 2015-3-19 19:12
通过插件方式写的还是?   如果插件写的话  js请求后端原生,然后后端做处理

处理完成返回,前端js监听到返回事件 就可以做处理的
作者: cuijiyi    时间: 2015-5-7 15:23
很不错,不错,学习学习。跨平台得顶起
作者: week2005    时间: 2015-5-7 15:50
未来属于html5 phonegap 微信 wap全部搞定




欢迎光临 PhoneGap中文网 (http://bbs.phonegap100.com/) Powered by Discuz! X3.2