|
沙发
楼主 |
发表于 2016-3-5 21:50:25
|
只看该作者
- package com.example.acmer;
- import android.os.Bundle;
- import android.view.Menu;
- import org.apache.cordova.*;
- public class MainActivity extends DroidGap {
- @Override
- public void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- super.setIntegerProperty("splashscreen", R.drawable.topic1);
- super.setIntegerProperty("loadUrlTimeoutValue", 60000);
- super.loadUrl("file:///android_asset/www/login.jsp", 3000);
- }
- @Override
- public boolean onCreateOptionsMenu(Menu menu) {
- // Inflate the menu; this adds items to the action bar if it is present.
- getMenuInflater().inflate(R.menu.main, menu);
- return true;
- }
- }
复制代码
我是上面的代码跳转到登陆页面,登陆页面检测用户名密码成功后再调用
location.href = "index.jsp?id=" + val.result.id + "&name=" + encodeURIComponent(val.result.username) + "&portrait=" + encodeURIComponent(val.result.portrait);
然后就出出现白屏的问题了
AndroidManifest.xml 是这样的
- <?xml version="1.0" encoding="utf-8"?>
- <manifest xmlns:android="http://schemas.android.com/apk/res/android"
- package="com.example.acmer"
- android:versionCode="1"
- android:versionName="1.0" >
- <uses-sdk
- android:minSdkVersion="8"
- android:targetSdkVersion="17" />
- <supports-screens
- android:largeScreens="true"
- android:normalScreens="true"
- android:smallScreens="true"
- android:resizeable="true"
- android:anyDensity="true"
- />
- <uses-permission android:name="android.permission.CAMERA" />
- <uses-permission android:name="android.permission.VIBRATE" />
- <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
- <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
- <uses-permission android:name="android.permission.ACCESS_LOCATION_EXTRA_COMMANDS" />
- <uses-permission android:name="android.permission.READ_PHONE_STATE" />
- <uses-permission android:name="android.permission.INTERNET" />
- <uses-permission android:name="android.permission.RECEIVE_SMS" />
- <uses-permission android:name="android.permission.RECORD_AUDIO" />
- <uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
- <uses-permission android:name="android.permission.READ_CONTACTS" />
- <uses-permission android:name="android.permission.WRITE_CONTACTS" />
- <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
- <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
- <uses-permission android:name="android.permission.GET_ACCOUNTS" />
- <application
-
- android:allowBackup="true"
- android:icon="@drawable/icon"
- android:label="@string/app_name"
-
- android:allowClearUserData="false"
- android:hardwareAccelerated="false"
-
- android:theme="@style/AppTheme" >
- <activity
- android:name="com.example.acmer.MainActivity"
- android:label="@string/app_name" >
- <intent-filter>
- <action android:name="android.intent.action.MAIN" />
- <category android:name="android.intent.category.LAUNCHER" />
- </intent-filter>
- </activity>
- </application>
- </manifest>
复制代码
|
|