I understand that home-replacement apps are a little (a lot) different than regular app. How exactly would I go about binding (if that's the right word) a view() to the home. When the home button is pressed, I want my home-replacement to be in the list. How would I do that? What specific property or activity() would allow me to do that? Thanks in advance
Code:
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.HOME" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
In the android manifest for your specific activity
Thanks
Thank you so much If you would like to know what I'm working on, you can visit my site at futurinnovations.blogspot.com. I would like all the help I can get.
Now that I can bind a gridView to the home, I need to know how to launch applications from that gridView. The gridView is made up of all the application icons, but I don't know how to make it to where the applications are waiting behind their icons. Oh, and can someone help me with making a free-form surface to place applications on that can be freely dragged and dropped? I have attempted to get the code from the example "Making Sense of Multitouch" from the Google Dev Blog to work. I enter in the code (not copy and paste, since I have my own variables and such) exactly like they do, run the application, and all I get is a blank screen. What am I doing wrong?
Sounds to me like you aren't inflating the XML
Sent from my ADR6300 using XDA App
Ummmm...it doesn't have an xml. I'm pretty sure that it is dynamically created. What would I put in the default xml? and how would I inflate it?
Related
Hi all. I have literally spent days on this, trawling through git source reps, playing with "Intent Playground", scanning logcat over and over again and I'm tearing my frickin hair out. Perleees, put me out of my misery one way or the other.
Developing an app that does funky stuff with text. Works fine except the last TODO which is to add my app to the "Share via" chooser. Source apps for the text I'm targetting are primarily mail clients.
I've added an intent filter (in fact, tried every combination I can think of) but my app never shows in the chooser.
Code:
<intent-filter>
<action android:name="android.intent.action.SEND" /
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="text/*" />
</intent-filter>
Here's a logcat fragment showing the chooser being created:
Code:
09-30 20:51:07.964: INFO/ActivityManager(124): Starting activity: Intent { act=android.intent.action.CHOOSER flg=0x10000000 cmp=android/com.android.internal.app.ChooserActivity (has extras) }
09-30 20:51:08.374: INFO/ActivityManager(124): Displayed activity android/com.android.internal.app.ChooserActivity: 381 ms (total 381 ms)
09-30 20:51:30.374: INFO/ActivityManager(124): Starting activity: Intent { act=share typ=text/plain flg=0x13000000 cmp=com.htc.android.mail/.ComposeActivity (has extras) }
As you can see, the share action was initiated in this case from the HTC mail client.
Any ideas? A free copy of my app to anyone who can help out. I know it's not much, but what else can I offer
I don't see a "Share Via" in the gmail client.
There is one in Astro file manager though.
Your app should show up if you long press a .txt file from Astro and click Send.
Hi, thanks for the response.
I should have mentioned it works fine as a send to target but it's the share via chooser I want to extend.
Cheers
Found the solution
Hi folks
Finally found the solution. Very pleased about this because I was just about to offer a $50 reward for one
<intent-filter>
<action android:name="share" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="text/*" />
</intent-filter>
Click to expand...
Click to collapse
There is NO documentation on this that I can find and I've never seen another intent name in this format. Maybe Google only want partners to be able to add apps to the Share Via choosers?
Anyway, up and running now.
Cheers all
How can apps like Llama and VoiceNotify be configured to read text now?
Has the UI moved somewhere else?
WibblyW said:
How can apps like Llama and VoiceNotify be configured to read text now?
Has the UI moved somewhere else?
Click to expand...
Click to collapse
Hi,
have you solved the problem?
I think that you must contact the developers and ask them to change some line in the AndroidManifest.xml. With Android 4.2 you must add the attribute 'android: permission' to the accessibility service. I had the same problem in my app AddonsDetector and solved in this way:
Code:
<service
android:name=".service.yourAccessibilityService"
[COLOR="Blue"][B]android:permission="android.permission.BIND_ACCESSIBILITY_SERVICE"[/B] [/COLOR]>
<intent-filter>
<action android:name="android.accessibilityservice.AccessibilityService" />
</intent-filter>
<meta-data
android:name="android.accessibilityservice"
android:resource="@xml/accessibility_service_config" />
</service>
Nope. Not solved. A 4.2 change i just have to live with
Sent from my Nexus 7 using Tapatalk 2
I am in the process of developing an android Home Screen Application, also known as Launcher.
However I ran into a couple of setbacks, setbacks which I will try to describe as best as I can, so hopefully one of you will be able to help me.
My main problem is when I quit my application by setting Android's launcher default as always, I can no longer use my home app, it just doesn't open up again.
This is how my manifest looks like:
<activity
android:name="com.modset.launcher.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>
<activity-alias
android:name=".MainActivityAlias"
android:targetActivity="com.modset.launcher.MainActivity"
>
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.HOME" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.MONKEY"/>
</intent-filter>
</activity-alias>
</activity>
With just this on the manifest whenever I press the HOME button I get the launcher chooser, if I opt for my Launcher everything works just fine, however if I opt for Android's stock launcher I can no longer use my app again.
It either just doesn't open, or if it does I can no longer use it as a Home app again.
I found this extra code which should be able to help me but it doesn't because after using it a message comes up saying "android settings have stopped working".
PackageManager manager = getPackageManager();
ComponentName compName = new ComponentName("com.modset.launcher", "com.modset.launcher.MainActivityAlias");
//ComponentName compName = new ComponentName("<Package Name>", "<Package Name.Alias Name>");
manager.setComponentEnabledSetting(compName,
PackageManager.COMPONENT_ENABLED_STATE_DISABLED, PackageManager.DONT_KILL_APP);
My biggest problem is that just by adding those lines in the manifest, the first code I mentioned, if I add that, after leaving my app by choosing android stock launcher as default, when i get back to my app it opens just fine however I can't use it as a home app again.
So...
I programatically thought of a work around, by using this code:
Intent selector = new Intent(Intent.ACTION_MAIN);
selector.addCategory(Intent.CATEGORY_HOME);
startActivity(selector);
And it is with this code I have the biggest problem, because when I add this in, the app simply doesn't open up again after exiting it and setting android stock launcher as the default home screen.
Please anyone help me solve this issue.
It will look more tidy if you put your code into
Code:
tags. ;)
When I go to view a video from a webpage or a news app I am always presented with a list of potential players (some of which I don't even have). I check the little box at the bottom of the list that says "always use this" or whatever, and then select RockPlayer. It all works fine but the Nook doesn't seem to remember this choice. It asks each time. Very annoying.
Does anyone know where this default app information is stored? A database file I could look at perhaps? Maybe something is not being set properly. I've made other default selections for other situations and they seem to take. Or maybe it's a RockPlayer issue?
<preferred-activities> inside /data/system/packages.xml
Always in the last place I look
So... this is what is there, but it's repeated over and over (and over--like for every time I've done it):
Code:
<preferred-activities>
<item name="com.redirectin.rockplayer.android.unified/com.redirectin.rockplayer.android.OpenRockPlayerActivity" match="600000" set="5">
<set name="com.estrongs.android.pop/.app.BrowserDownloaderActivity" />
<set name="com.estrongs.android.pop/.app.PopVideoPlayerProxyActivity" />
<set name="com.opera.browser/com.opera.Opera" />
<set name="com.alensw.PicFolder/.StreamingActivity" />
<set name="com.redirectin.rockplayer.android.unified/com.redirectin.rockplayer.android.OpenRockPlayerActivity" />
<filter>
<action name="android.intent.action.VIEW" />
<cat name="android.intent.category.DEFAULT" />
<type name="video/mp4" />
</filter>
</item>
I don't see the BBC News app mentioned in a similar vein, but it behaves in exactly the same way. Nothing in the code above jumps out at me as a novice, but the fact that there are many, many entries in the file all the same does not seem good.
Ideas?
Well, the easiest solution is to just gut the preferred-activities:
Code:
<preferred-activities>
</preferred-activities>
Your Nook may ask you once about a few intents, but that should be it.
It's possible that packages.xml got corrupted.
Also, depending on how a file gets opened there may be different filters for mimetype vs. path filters.
If you are still having problems, narrow it down to exactly how you are trying to open the file.
Use logcat and see what intent generates the picker dialog.
Thin ice here...
So here's an excerpt from the Android Manifest.xml of Alreader 1.7.7:
Code:
<activity android:configChanges="locale|touchscreen|keyboard|keyboardHidden|navigation|orientation|uiMode|screenSize|smallestScreenSize|fontScale"
android:label="@string/dialogopen_library"
android:launchMode="singleTop"
android:name="com.neverland.alr.AlReader3GridCatalog"
android:parentActivityName="com.neverland.alr.AlReader3Activity"/>
The activity "com.neverland.alr.AlReader3GridCatalog" is, as far as I can tell, what calls the Library. At least ADW Launcher thinks so, although attempting to create a shortcut fails. In fact, every activity listed for Alreader fails from outside the app as far as I can tell. I would like to be able to go straight to the Library. My reading--probably insufficient--leads me to think that "android:exportable=true" needs to be added somewhere in this mess to make that possible.
I've tried that but apktool throws out all kinds of errors when trying to recompile the app.
Am I being too simple?
nmyshkin said:
"android:exportable=true" needs to be added somewhere...
Click to expand...
Click to collapse
Make that:
Code:
android:exported="true"
You could also add your own intent filter:
Code:
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
Which turns it into a regular launchable app.
It also makes the android:exported="true" by default without the explicit line.
Renate NST said:
Make that:
Code:
android:exported="true"
Click to expand...
Click to collapse
OK, so that was just a stupid mistake on my part I actually did use "exported" when I tried, but apparently my apktool version was just too old. I got the app to recompile with the newest version of apktool, adding android:exported="true" to the section where the library activity is mentioned. So far, so good. Then I signed the app and it actually installed!
When I call the activity I actually get a blank screen with a little band at the top which says "Library" (android sarcasm). The menu button brings up a few items, each of which tosses me back out except for a screen formatting option: one or two columns, etc.
So...I'm guessing that more of the activities associated with the Library need the same treatment in the Android Manifest file for the whole shebang to work.
Edit: just to be a bit OCD, I added the exported phrase to each and every activity mentioned. This yields a similar result for each: a blank page with a title bar and some menu-button options that don't work. I am trying:
Code:
am start -n com.neverland.alreader/con.neverland.alr.AlReader3GridCatalog
as an example. I am wondering if the declaration of a "parent activity" in each section:
Code:
<activity android:configChanges="fontScale|keyboard|keyboardHidden|locale|navigation|orientation|screenSize|smallestScreenSize|touchscreen|uiMode"
android:label="@string/dialogopen_library"
android:launchMode="singleTop"
android:name="com.neverland.alr.AlReader3GridCatalog" android:exported="true" [B]android:parentActivityName="com.neverland.alr.AlReader3Activity[/B]"/>
has something to do with my inability to get to a specific activity from outside the app.
nmyshkin said:
I am wondering if the declaration of a "parent activity"...
Click to expand...
Click to collapse
parentActivityName really only has to do with navigation, not a real dependency.