This is a weird problem, My intent can't switch between activities in case of Android 4.0+ devices, However, on devices with android 2.2/2.3 it works fine.
This is how I define the intent for my class PhotoActivity.
public static final void startActivityForResult(Activity parent, int requestCode, String userName, String photoUrl, Bitmap preview, boolean isMugshot) {
System.out.println("photoactivity started" +requestCode+"second"+parent);
Intent intent = new Intent(parent, PhotoActivity.class)
.putExtra(USERNAME, userName)
.putExtra(PHOTOURL, photoUrl)
.putExtra(PREVIEW, preview)
.putExtra(IS_MUGSHOT, isMugshot);
parent.startActivityForResult(intent, requestCode);
}
I want to switch to this activity class as above from another class upon a particular user touch response. I define this as follows
case R.id.ImgAvatar:
PhotoActivity.startActivityForResult(this, REQUEST_SHOW_AVATOR, mUserName, avatarUrl, mAvatar, true);
break;
My code is fine since in case of android 2.3/2.2 , I can switch in between the actvities. However, while using devices with android 4.0+, Rather than switching between activities upon touch response, I am reverted back to my main activity(clueless why).
I also noticed the console output was different in both 2.2 and 4.0 version. I am still not able to guess why android 4.0 is causing trouble.
This is the log when the activity starts correctly (android 2.2/2.3),
04-11 10:29:21.665: I/System.out(924): photoactivity started userdhttp://www.l-somewhere.com/media/Users/a6cb0167255045a9a2a16bb3411bc2/Mugshot/324c3a02b252428b8676e42671e392c2.jpg
04-11 10:29:21.675: I/System.out(924): photoactivity started4096secondcom.lsomewhere.android.UserDataActivity#44ae2b80
04-11 10:29:21.845: D/dalvikvm(924): GC_EXTERNAL_ALLOC freed 1481 objects / 289856 bytes in 84ms
04-11 10:29:21.855: I/PhotoActivity(924): onCreate// **rightly called** ,switch of activity
04-11 10:29:21.855: I/pthread(924): ## thread 924 is creating thread #dalvik/vm/Thread.c:1443
04-11 10:29:21.855: I/pthread(924): ## thread 1008 is created success
04-11 10:29:25.325: D/dalvikvm(938): GC_FOR_MALLOC freed 1339 objects / 483712 bytes in 69ms
This is the log in case of android 4.0+
04-11 10:34:47.415: I/System.out(22717): photoactivity started userdhttp://www.l-somewhere.com/media/Users/a6cb0167255045a9a2a16bb3411bc2/Mugshot/324c3a02b252428b8676e42671e392c2.jpg
04-11 10:34:47.420: I/System.out(22717): photoactivity started4096secondcom.lsomewhere.android.UserDataActivity#424d6db0
04-11 10:34:47.520: D/SensorManager(22717): unregisterListener:: Listener= android.view.OrientationEventListener$SensorEventListenerImpl#4201ce20
04-11 10:34:47.525: D/Sensors(22717): Remain listener = Sending .. normal delay 200ms
04-11 10:34:47.525: I/Sensors(22717): sendDelay --- 200000000
04-11 10:34:47.525: D/SensorManager(22717): JNI - sendDelay
04-11 10:34:47.525: I/SensorManager(22717): Set normal delay = true
04-11 10:34:47.745: D/dalvikvm(24379): GC_CONCURRENT freed 184K, 10% free 12467K/13703K, paused 3ms+12ms, total 29ms
04-11 10:34:47.750: W/CursorWrapperInner(24379): Cursor finalized without prior close()
04-11 10:34:47.775: I/MainActivity(24379): RegistrationId, DeviceTocken: //**I don't know why rather than starting the photo activity, the main activity is called,**
Clearly, in case of android 4.0+ , my second activity is not called and i am reverted back to main activity. Another interesting observation is that the intent is actually called, i.e. I reach the function where I define the intent, but It seems like intent cannot start the activity, so the intent does run but It can't start the new activity. I am clueless since my code is not giving any run/compile time errors making it difficult to find out the problem. Appreciate the help.
Here is my Manifest
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.lsomewhere.android"
android:versionCode="37"
android:versionName="1.0.37" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="16" />
<permission
android:name="com.lsomewhere.android.permission.C2D_MESSAGE"
android:protectionLevel="signature" />
<uses-permission android:name="com.lsomewhere.android.permission.C2D_MESSAGE" />
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.CALL_PHONE" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.READ_PHONE_STATE"/>
<application
android:icon="#drawable/ic_launcher_72x72"
android:label="#string/app_name" >
<uses-library
android:name="com.google.android.maps"
android:required="true" />
<service
android:name=".LsCommService"
android:process=":apisrv" >
<intent-filter>
<action android:name="com.lsomewhere.android.LSAPISERVICE" />
</intent-filter>
</service>
<service android:name=".GCMIntentService" />
<receiver
android:name="com.google.android.gcm.GCMBroadcastReceiver"
android:permission="com.google.android.c2dm.permission.SEND" >
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
<action android:name="com.google.android.c2dm.intent.REGISTRATION" />
<category android:name="com.lsomewhere.android" />
</intent-filter>
</receiver>
<activity
android:name=".SplashActivity"
android:configChanges="keyboardHidden|orientation"
android:label="#string/app_name"
android:screenOrientation="portrait"
android:theme="#android:style/Theme.Black.NoTitleBar" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".LoginActivity"
android:configChanges="keyboardHidden|orientation"
android:label="#string/login"
android:screenOrientation="portrait"
android:theme="#android:style/Theme.Black.NoTitleBar"
android:windowSoftInputMode="stateUnspecified|adjustPan" >
</activity>
<activity
android:name=".ProfileActivity"
android:configChanges="keyboardHidden|orientation"
android:label="#string/login"
android:screenOrientation="portrait"
android:theme="#android:style/Theme.Black.NoTitleBar" >
</activity>
<activity
android:name=".AvatarActivity"
android:configChanges="keyboardHidden|orientation"
android:label="#string/upload_your_photo"
android:screenOrientation="portrait"
android:theme="#android:style/Theme.Black.NoTitleBar" >
</activity>
<activity
android:name=".MainActivity"
android:configChanges="keyboardHidden|orientation"
android:label="#string/app_name"
android:screenOrientation="portrait"
android:theme="#android:style/Theme.Black.NoTitleBar" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".UserDataActivity"
android:configChanges="keyboardHidden|orientation"
android:label="#string/user_data"
android:screenOrientation="portrait"
android:theme="#android:style/Theme.Black.NoTitleBar"
android:windowSoftInputMode="stateHidden" >
</activity>
<activity
android:name=".GalleryActivity"
android:configChanges="keyboardHidden|orientation"
android:screenOrientation="portrait"
android:theme="#android:style/Theme.Black.NoTitleBar"
>
</activity>
<activity
android:name=".PhotoActivity"
android:configChanges="keyboardHidden|orientation"
android:screenOrientation="portrait"
android:theme="#android:style/Theme.Black.NoTitleBar"
>
</activity>
<activity
android:name=".PasswordActivity"
android:configChanges="keyboardHidden|orientation"
android:screenOrientation="portrait"
android:theme="#android:style/Theme.Black.NoTitleBar"
android:windowSoftInputMode="stateVisible" >
</activity>
<activity
android:name=".AboutActivity"
android:configChanges="keyboardHidden|orientation"
android:theme="#android:style/Theme.Black.NoTitleBar" >
</activity>
<activity
android:name=".AdvrDataActivity"
android:screenOrientation="portrait"
android:theme="#android:style/Theme.Black.NoTitleBar" >
</activity>
<activity
android:name=".PageBase"
android:screenOrientation="portrait"
android:theme="#android:style/Theme.Black.NoTitleBar" >
</activity>
<activity android:name="com.lsomewhere.android.TutorialActivity" android:theme="#android:style/Theme.Black.NoTitleBar" android:screenOrientation="portrait" android:configChanges="keyboardHidden|orientation"></activity>
<activity android:name="com.kuad.ADDisplay"/>
</application>
Related
I'm not able to subscribe to push notifications. I did:
1) I created a firebase application, with the same package name as my MainActivity package name;
2) I downloaded the google-service.json file and stored it in my /app/ next to the gradle file;
3) I added the C2D and WAKE-LOCK permissions as the google guide showed;
4) I added the API-KEY in the pushnotification's setting tab in quickblox admin panel;
5) I modified the manifest as showed by the quickblox guide;
6) I added a push-notification listener and a local broadcast receiver as shown by the same guide as above.
That's how my manifest looks like:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="it.unical.sistemidistribuiti.ddf.appraia">
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<permission android:name="it.unical.sistemidistribuiti.ddf.appraia.permission.C2D_MESSAGE"
android:protectionLevel="signature" />
<uses-permission android:name="it.unical.sistemidistribuiti.ddf.appraia.permission.C2D_MESSAGE"/>
<meta-data android:name="com.quickblox.messages.TYPE" android:value="FCM" />
<meta-data android:name="com.quickblox.messages.SENDER_ID" android:value="#string/sender_id" />
<meta-data android:name="com.quickblox.messages.QB_ENVIRONMENT" android:value="DEVELOPMENT" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:supportsRtl="true"
android:largeHeap="true"
android:theme="#style/AppTheme"
android:name="it.unical.sistemidistribuiti.ddf.appraia.AppraiaApplication">
<activity
android:name="it.unical.sistemidistribuiti.ddf.appraia.StartActivity"
android:label="#string/app_name"
android:theme="#style/AppTheme.NoActionBar"
android:screenOrientation="portrait"
android:configChanges="orientation|keyboardHidden">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="it.unical.sistemidistribuiti.ddf.appraia.MainActivity"
android:label="#string/app_name"
android:theme="#style/AppTheme.NoActionBar"
android:screenOrientation="portrait"
android:configChanges="orientation|keyboardHidden">
</activity>
<activity
android:name="it.unical.sistemidistribuiti.ddf.appraia.NewsDetailActivity"
android:label="#string/app_name"
android:theme="#style/AppTheme.NoActionBar"
android:screenOrientation="portrait"
android:configChanges="orientation|keyboardHidden">
</activity>
<activity
android:name="it.unical.sistemidistribuiti.ddf.appraia.CreatePostActivity"
android:label="#string/app_name"
android:theme="#style/AppTheme.NoActionBar"
android:screenOrientation="portrait"
android:configChanges="orientation|keyboardHidden">
</activity>
<activity
android:name="it.unical.sistemidistribuiti.ddf.appraia.UserProfileActivity"
android:label="#string/app_name"
android:theme="#style/AppTheme.NoActionBar"
android:screenOrientation="portrait"
android:configChanges="orientation|keyboardHidden">
</activity>
<receiver
android:name="com.google.android.gms.gcm.GcmReceiver"
android:exported="true"
android:permission="com.google.android.c2dm.permission.SEND" >
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
<category android:name="com.example.gcm" />
</intent-filter>
</receiver>
<service
android:name="com.quickblox.messages.services.fcm.QBFcmPushListenerService">
<intent-filter>
<action android:name="com.google.firebase.MESSAGING_EVENT" />
</intent-filter>
</service>
</application>
Since I'm using 3.2 sdk version, the app should automatically subscribe the user to push-notifications, but this not happen. Actually the listener code prints nothing:
//This is in AppraiaApplication extends Application
#Override
public void onCreate() {
super.onCreate();
QBSettings.getInstance().init(getApplicationContext(), APP_ID, AUTH_KEY, AUTH_SECRET);
QBSettings.getInstance().setAccountKey(ACCOUNT_KEY);
QBPushManager.getInstance().addListener(new QBPushManager.QBSubscribeListener() {
#Override
public void onSubscriptionCreated() {
System.out.println("onSubscriptionCreated");
}
#Override
public void onSubscriptionError(final Exception e, int resultCode) {
System.out.println("onSubscriptionError" + e);
if (resultCode >= 0) {
System.out.println("Google play service exception");
}
System.out.println("onSubscriptionError " + e.getMessage());
}
});
QBSettings.getInstance().setEnablePushNotification(true);
LocalBroadcastManager.getInstance(this).registerReceiver(pushBroadcastReceiver,
new IntentFilter("new-push-event"));
System.out.println("Application creation ended");
}
What am I doing wrong?
Looks like you don't make signIn with user, and subscription is not performed. Also have a look in logs, there is can be info something like D/QBASDK: SubscribeService: SubscribeService created. So, you can figure out whether the subscription is executed at all.
I got a problem regarding Google AdMob:
I try to display a Interstitial, for this I have added the AdActivity, permissions and meta-tags to manifest.
Manifest:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.lunation.warface"
android:versionCode="10"
android:versionName="1.4" >
<uses-sdk
android:minSdkVersion="13"
android:targetSdkVersion="19" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<application
android:allowBackup="true"
android:icon="#drawable/icon"
android:label="#string/app_name"
android:largeHeap="true"
android:theme="#style/AppTheme"
android:windowSoftInputMode="adjustPan|adjustResize" >
<!--This meta-data tag is required to use Google Play Services.-->
<meta-data android:name="com.google.android.gms.version"
android:value="#integer/google_play_services_version" />
<!--Include the AdActivity configChanges and theme. -->
<activity android:name="com.google.android.gms.ads.AdActivity"
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"
android:theme="#android:style/Theme.Translucent" />
<activity
android:name=".MainActivity"
android:label="#string/app_name"
android:screenOrientation="sensorPortrait"
android:windowSoftInputMode="adjustPan|adjustResize" >
<intent-filter>
</intent-filter>
</activity>
<activity
android:name=".SplashScreen"
android:noHistory="true"
android:screenOrientation="sensorPortrait"
android:theme="#style/Theme.Transparent" >
<intent-filter>
<action android:name="android.intent.action.MAIN" >
</action>
<category android:name="android.intent.category.LAUNCHER" >
</category>
</intent-filter>
</activity>
<activity android:name="gallery.FullScreenViewActivity"></activity>
</application>
</manifest>
In MainActivity:
mInterstitialAd = new InterstitialAd(this);
mInterstitialAd.setAdUnitId("xxx/xxx");
AdRequest adRequest = new AdRequest.Builder().build();
mInterstitialAd.loadAd(adRequest);
if (mInterstitialAd != null && mInterstitialAd.isLoaded()) {
mInterstitialAd.show();
}
Logcat:
04-04 15:15:19.397: W/Ads(19752): There was a problem getting an ad response. ErrorCode: 0
04-04 15:15:19.407: I/dalvikvm(19752): Could not find method android.webkit.WebSettings.setMixedContentMode, referenced from method com.google.android.gms.ads.internal.s.g.<init>
04-04 15:15:19.407: W/dalvikvm(19752): VFY: unable to resolve virtual method 3153: Landroid/webkit/WebSettings;.setMixedContentMode (I)V
04-04 15:15:19.407: D/dalvikvm(19752): VFY: replacing opcode 0x6e at 0x004a
04-04 15:15:19.502: W/Ads(19752): Failed to load ad: 0
Besides there is also a compilation error:
Conversion of dalvik format failed with error code 1
I tried about 20 answers, still not working.
I also dont know whether the problem is the unit id, I can change
mInterstitialAd.setAdUnitId("xxx/xxx");
to:
mInterstitialAd.setAdUnitId("xxx");
and I got the same errors.
I use the following external libraries:
android support v4&v7, picasso, ftpclient(commons, httpmime),FAB
Does somebody have a advice?
Greetings
Solution found!
Seems like some features in CyanogenMod blocks AdMob.
Flashed a new version WITHOUT Adaware and blocking Tools.
WORKING NOW :D
I am getting the following error:
ActivityManager: java.lang.SecurityException: Permission Denial: starting Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=com.optionpricing/.optionListNew } from null (pid=1160, uid=2000) requires null
I am new to programming in Android and I could not make sense of the other postings related to my problem. I wonder if there is an issue with the optionListNew class? Can someone lend a hand so I can move on to completing my app. Also, the app runs in my virtual device, and I only get this error when I try to test it on my actual phone.
Any ideas are appreciated. Below is the manifest file.
<?xml version="1.0" encoding="UTF-8"?>
<manifest android:versionCode="1" android:versionName="1.0"
package="com.optionpricing" xmlns:android="http://schemas.android.com/apk/res/android">
<uses-sdk android:minSdkVersion="8"/>
<application android:icon="#drawable/icon"
android:label="#string/app_name"
android:debuggable="true">
<activity android:name=".optionListNew">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<activity android:name=".OptionPricing"/>
<activity android:name=".optionListNew"/>
<activity android:name=".futureOptionActivity"/>
<activity android:name=".currencyOptionActivity"/>
<activity android:name=".gapOptionActivity"/>
<activity android:name=".gapOptionList01"/>
<activity android:name=".barrierSingleUpInActivity"/>
<activity android:name=".testActivity"/>
<activity android:name=".barrierlistview"/>
<activity android:name=".barrierSingleDownInActivity"/>
</application>
</manifest>
You added "optionListNew" activity twice in the manifest file.. remove below activity by deleting this line
<activity android:name=".optionListNew"/>
Your Manifest.xml code will become
<?xml version="1.0" encoding="UTF-8"?>
<manifest android:versionCode="1" android:versionName="1.0"
package="com.optionpricing" xmlns:android="http://schemas.android.com/apk/res/android">
<uses-sdk android:minSdkVersion="8"/>
<application android:icon="#drawable/icon"
android:label="#string/app_name"
android:debuggable="true">
<activity android:name=".optionListNew">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<activity android:name=".OptionPricing"/>
<activity android:name=".futureOptionActivity"/>
<activity android:name=".currencyOptionActivity"/>
<activity android:name=".gapOptionActivity"/>
<activity android:name=".gapOptionList01"/>
<activity android:name=".barrierSingleUpInActivity"/>
<activity android:name=".testActivity"/>
<activity android:name=".barrierlistview"/>
<activity android:name=".barrierSingleDownInActivity"/>
</application>
</manifest>
optionListNew is present twice in the manifest. Remove the second.
I'm working on an android project in which one of the activities includes a Maps view. I'm only after doing the code for displaying a simple Google Map but I bumped into this NoClassDefFoundError. I have checked some similar questions and tried the suggested solutions but still won't work. I have activated the Internet permision in the manifest file and the user library for the application. Does anyone have any suggestions on what might be the problem? Here's the activity code:
package com.mad.mylit;
import android.os.Bundle;
import com.google.android.maps.MapActivity;
import com.google.android.maps.MapView;
public class LocationsActivity extends MapActivity {
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.location);
}
#Override
protected boolean isRouteDisplayed() {
// TODO Auto-generated method stub
return false;
}
}
And here's my manifest file:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.mad.mylit"
android:versionCode="1"
android:versionName="1.0" android:installLocation="auto">
<uses-sdk android:minSdkVersion="10" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.INTERNET"/>
<application
android:icon="#drawable/icon"
android:label="#string/app_name" >
<uses-library android:name="com.google.android.maps"/>
<activity
android:name=".MyLitActivity"
android:label="#string/app_name"
>
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".MapsActivity"></activity>
<activity android:name=".MyProfileActivity"></activity>
<activity android:name=".BusActivity"></activity>
<activity android:name=".EventsActivity"></activity>
<activity android:name=".LocationsActivity"></activity>
<activity android:name=".NotesActivity"></activity>
<activity android:name=".TimetableActivity"></activity>
<activity android:name=".MondayActivity"></activity>
<activity android:name=".TuesdayActivity"></activity>
<activity android:name=".WednesdayActivity"></activity>
<activity android:name=".ThursdayActivity"></activity>
<activity android:name=".FridayActivity"></activity>
<activity android:name=".CaherdavinActivity"></activity>
<activity android:name=".RaheenActivity"></activity>
<activity android:name=".UniversityActivity"></activity>
<activity android:name=".SplashScreen"
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>
All of the activities are in the same package.
Try to get new maps API key with your personal keystore.
Have you recently updated your ADT plugin?
Here and here are some talks about same prblem..
i want to change my launching activity.for the moment my manifest is this:
<application android:icon="#drawable/iconbj" android:label="#string/app_name"
android:debuggable="true">
<activity android:name=".Main" android:label="#string/app_name" android:screenOrientation="landscape">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:label="DemoPlayActivity" android:name="DemoPlayActivity" android:screenOrientation="landscape"></activity>
</application>
now I have created another activity which is a splash screen and i want to launch this instead of Main so I tried this way:
<application android:icon="#drawable/iconbj" android:label="#string/app_name"
android:debuggable="true">
<activity android:name=".Splash" android:label="#string/app_name"
android:screenOrientation="landscape">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="Main" android:label="Main"
android:screenOrientation="landscape">
</activity>
<activity android:label="DemoPlayActivity" android:name="DemoPlayActivity"
android:screenOrientation="landscape"></activity>
</application>
but i get thisproblem with permission:
[2011-03-31 16:32:44 - BlackJackNuovo]
ActivityManager:
java.lang.SecurityException:
Permission Denial: starting Intent {
act=android.intent.action.MAIN
cat=[android.intent.category.LAUNCHER]
flg=0x10000000
cmp=com.phinet.android.blackjack/.Main
} from null (pid=-1, uid=-1) requires
null.
please help me :)
Update
NO WAY. I did this way:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.phinet.android.blackjack" android:versionCode="1"
android:versionName="1.0">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.VIBRATE" />
<application android:icon="#drawable/iconbj" android:label="#string/app_name"
android:debuggable="true">
<activity android:name="com.phinet.android.blackjack.Splash" android:label="Splash"
android:screenOrientation="landscape">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="com.phinet.android.blackjack.Main" android:label="Main"
android:screenOrientation="landscape">
</activity>
<activity android:label="com.phinet.android.blackjack.DemoPlayActivity" android:name="DemoPlayActivity"
android:screenOrientation="landscape"></activity>
</application>
</manifest>
but it seems to lunch always the Main activity,this is the concole log:
[2011-04-01 10:57:10 - BlackJackNuovo] Uploading BlackJackNuovo.apk onto device '9000d365e767'
[2011-04-01 10:57:16 - BlackJackNuovo] Installing BlackJackNuovo.apk...
[2011-04-01 10:57:32 - BlackJackNuovo] Success!
[2011-04-01 10:57:32 - BlackJackNuovo] Starting activity com.phinet.android.blackjack.Main on device 9000d365e767
[2011-04-01 10:57:32 - BlackJackNuovo] ActivityManager: Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.phinet.android.blackjack/.Main }
[2011-04-01 10:57:35 - BlackJackNuovo] ActivityManager: java.lang.SecurityException: Permission Denial: starting Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=com.phinet.android.blackjack/.Main } from null (pid=-1, uid=-1) requires null
WHY?
<activity android:name="Main" android:label="Main"
android:screenOrientation="landscape">
</activity>
<activity android:label="DemoPlayActivity" android:name="DemoPlayActivity"
android:screenOrientation="landscape"></activity>
Should still have the leading .
<activity android:name=".Main" android:label="Main" android:screenOrientation="landscape">
</activity>
<activity android:label=".DemoPlayActivity" android:name="DemoPlayActivity"android:screenOrientation="landscape">
</activity>
This is stating it has a relative path to your Classes. You could make absolute references if you wished, i.e. "com.your.app.Main"