Can't find Activity error

by John Lussmyer » Thu, 13 Jan 2011 07:45:18 GMT


Sponsored Links
 I'm trying to use an Intent() to send a little data to another app.
So far, I've been unable to get the startActivity() to succeed.  It always
fails with a ActivityNotFound exception.
I just haven't been able to figure out WHY my activity isn't being found.

invoking code is:

                Intent intent = new
Intent("com.casadelgato.lifewallpaper.UPDATEPREFS");
                intent.setPackage("com.casadelgato.lifewallpaper");
                intent.putExtra("PrefUpdate", true);
                startActivity(intent);


Manifest of target app is:

<?xml version="1.0" encoding="utf-8"?>
<manifest
    xmlns:android=" http://schemas.android.com/apk/res/android" ;
    package="com.casadelgato.lifewallpaper"
    android:versionName="1.0.3"
    android:versionCode="4"
    android:sharedUserId="@string/SharedUserID">
    <uses-sdk
        android:minSdkVersion="7" />
    <uses-feature
        android:name="android.software.live_wallpaper"
        android:required="true" />
    <application
        android:icon="@drawable/icon"
        android:label="@string/app_name"
        android:process="@string/SharedUserID">

        <service
            android:label="@string/servicelabel"
            android:permission="android.permission.BIND_WALLPAPER"
            android:name="LifeWallpaper"
            android:enabled="true">
            <intent-filter>
                <action

android:name="android.service.wallpaper.WallpaperService" />
            </intent-filter>
            <meta-data
                android:name="android.service.wallpaper"
                android:resource="@xml/settingsconfig" />
        </service>
        <activity
            android:label="Life Wallpaper Settings"
            android:theme="@android:style/Theme.Light.WallpaperSettings"
            android:exported="true"
            android:enabled="true"
            android:name="LifeSettings">
            <intent-filter>
                <action
                    android:name="com.casadelgato.lifewallpaper.UPDATEPREFS"
/>
            </intent-filter>
        </activity>

    </application>


</manifest>

-- 



Re: Can't find Activity error

by Kostya Vasilyev » Thu, 13 Jan 2011 08:47:07 GMT


 You need category_default in the intent filter of your activity for launch
by action string to work.

--
Kostya Vasilyev --  http://kmansoft.wordpress.com 
13.01.2011 2:46  "John Lussmyer" <johnlussm...@gmail.com>
:

-- 


Sponsored Links


Re: Can't find Activity error

by John Lussmyer » Thu, 13 Jan 2011 08:55:51 GMT


 So, I modified the manifest to have:

            <intent-filter>
                <action
                    android:name="com.casadelgato.lifewallpaper.UPDATEPREFS"
/>
                <category
                    android:name="android.intent.category.CATEGORY_DEFAULT"
/>
            </intent-filter>

Made no difference.

2011/1/12 Kostya Vasilyev <kmans...@gmail.com>


-- 



Re: Can't find Activity error

by Mark Murphy » Thu, 13 Jan 2011 08:59:44 GMT


 I'd get rid of the setPackage() call.






-- 
Mark Murphy (a Commons Guy)
 http://commonsware.com  |  http://github.com/commonsguy 
 http://commonsware.com/blog  |  http://twitter.com/commonsguy 

Android App Developer Books:  http://commonsware.com/books 

-- 



Re: Can't find Activity error

by John Lussmyer » Thu, 13 Jan 2011 09:06:01 GMT


 Didn't help.





-- 



Re: Can't find Activity error

by Stephen Jungels » Thu, 13 Jan 2011 09:22:11 GMT


 Unless your android:name elements are fully qualified, they should
begin with a period, should they not?





-- 



Re: Can't find Activity error

by John Lussmyer » Thu, 13 Jan 2011 10:20:58 GMT


 Should they?
And which ones are you talking about?





-- 



Re: Can't find Activity error

by Kostya Vasilyev » Thu, 13 Jan 2011 16:47:20 GMT


 It should be like this:

In the manifest:

<activity android:label="Life Wallpaper Settings" android:theme="@android:style/Theme.Light.WallpaperSettings" android:exported="true" android:enabled="true" android:name="LifeSettings">
You'd only need the leading dot if your activity class was in a sub-package: e.g. ".ui.settings.LifeSettings"
<intent-filter> <action android:name="com.casadelgato.lifewallpaper.UPDATEPREFS" />
*<category android:name="android.intent.category.DEFAULT" />* ( not category_default )
</intent-filter> </activity>
In the code: Intent intent = new Intent("com.casadelgato.lifewallpaper.UPDATEPREFS"); intent.putExtra(...); startActivity(intent); Don't worry about setting the package or class name, as that's the point of launching by action string. -- Kostya 13.01.2011 4:37, John Lussmyer ?????:
Should they? And which ones are you talking about? On Wed, Jan 12, 2011 at 5:22 PM, Stephen Jungels <sjung...@gmail.com Unless your android:name elements are fully qualified, they should begin with a period, should they not? --
-- Kostya Vasilyev -- WiFi Manager + pretty widget -- http://kmansoft.wordpress.com --



Re: Can't find Activity error

by Stephen Jungels » Fri, 14 Jan 2011 09:59:45 GMT


 


I was talking about the name elements of your service and activity
definitions. A technique much like this works in my own code and the
only thing that jumps out as different about your manifest file is the
lack of fully-qualified class names.

(Referring to this page, under the heading "Declaring class names":)
 http://developer.android.com/guide/topics/manifest/manifest-intro.html 

SJ




-- 



Other Threads

1. How to Buy Android Apps in Countries th at Don鈥檛 Support Paids Apps

buying paid apps without using market enabler..check this out..

http://www.androidtapp.com/how-to-buy-android-apps-in-countries-that-dont-support-paids-apps/

-- 
"Indonesian Android Community [id-android]" 

2. Cannot play MPEG4 video stream on Android SDK 1.6

Hi,

I am sending a MPEG4  video stream in RTP format over RTSP to my
android emulator using ffmpeg and ffserver.  I use the Android
VideoView to play the RTSP stream.  I do not see the video.  The error
in LogCat is pasted below.  Is there some specific that I need to do?

If I use the Android 2.2 to run the same code, the video plays fine.

I also tried coding video using H263, but that stream does not play in
1.6/2.2  emulator
===================================================================================
07-16 15:50:46.073: DEBUG/PlayerDriver(554): buffering (6)
07-16 15:50:46.273: DEBUG/PlayerDriver(554): buffering (6)
07-16 15:50:46.474: DEBUG/PlayerDriver(554): buffering (73)
07-16 15:50:46.683: DEBUG/PlayerDriver(554): buffering (73)
07-16 15:50:46.884: DEBUG/PlayerDriver(554): buffering (73)
07-16 15:50:47.092: DEBUG/PlayerDriver(554): buffering (73)
07-16 15:50:47.293: DEBUG/PlayerDriver(554): buffering (73)
07-16 15:50:47.492: DEBUG/PlayerDriver(554): buffering (73)
07-16 15:50:47.703: DEBUG/PlayerDriver(554): buffering (73)
07-16 15:50:47.902: DEBUG/PlayerDriver(554): buffering (73)
07-16 15:50:48.113: DEBUG/PlayerDriver(554): buffering (73)
07-16 15:50:48.123: DEBUG/PlayerDriver(554): buffering (100)
07-16 15:50:48.162: ERROR/SW_DEC(554): PV SW DECODER is used for MPEG4
07-16 15:50:48.223: INFO/MP(807): onPrepared called
07-16 15:50:48.223: INFO/MP(807): vv start
07-16 15:50:48.252: INFO/mediaDuration3(807): -1
07-16 15:50:48.384: ERROR/PlayerDriver(554): HandleErrorEvent:
PVMFErrCorrupt
07-16 15:50:48.652: WARN/PlayerDriver(554):
PVMFInfoErrorHandlingComplete
07-16 15:50:48.652: ERROR/MediaPlayer(807): error (1, -10)
07-16 15:50:48.652: ERROR/MediaPlayer(807): Attempt to call
getDuration without a valid mediaplayer
07-16 15:50:48.652: ERROR/MediaPlayer(807): error (-38, 0)
07-16 15:50:48.794: ERROR/MediaPlayer(807): Error (1,-10)
07-16 15:50:48.794: DEBUG/VideoView(807): Error: 1,-10
07-16 15:50:48.794: INFO/MP(807): onError called
07-16 15:50:49.063: ERROR/MediaPlayer(807): Error (-38,0)
07-16 15:50:49.072: DEBUG/VideoView(807): Error: -38,0
07-16 15:50:49.072: INFO/MP(807): onError called
===================================================================================

Regards,
Yadnesh

-- 

3. How to custom build steps in Eclipse ADT plug in.

4. Where is source code (or git file) for ContactsContract.QuickContact

5. Radar View

6. Permanent socket connection drains battery

7. Splashing The Liquid (ACER Smart Handheld Competition)