Issue with #string and developing for android - android

I am trying to write a sms receiver for android. But I am having issues. I found an example here: http://www.apriorit.com/our-company/dev-blog/227-handle-sms-on-android
Eclipse had underlined the line :
android:text="Update SMS list" />
So I changed it to:
<Button android:layout_height="wrap_content"
android:layout_width="match_parent"
android:layout_margin="2dip"
android:text="#string/UpdateList"
android:id="#+id/UpdateList"/>
and added this into strings.xml :
<string name="UpdateList">Update SMS List</string>
The issue is now with the line :
android:text="#string/UpdateList"
This is the error message:
[2013-03-14 16:37:07 - FindMyPhone] ActivityManager: Warning: Activity not started, its current task has been brought to the front
Does anyone see what the issue is? Or have an idea of how to fix it?

Underline Issue:
I reckon the Linter just hasn't noticed the change yet, I often find that saving the file, closing it and opening it up again, is required to clear it's "cache", if it can be called that, of errors / warnings.
ActivityManager: Warning: Activity not started, its current task has
been brought to the front
This just means that the Activity is open on the device/emulator and you're launching it again. This happens if the code hasn't changed since the last launch, and it brings the current Activity to the front.

[2013-03-14 16:37:07 - FindMyPhone] ActivityManager: Warning: Activity not started, its current task has been brought to the front
This generally indicates that the APK being installed on the device isn't different from what is on there already. Based on your question, the error can be resolved by cleaning and rebuilding the application, then reloading it on to your device.

[2013-03-14 16:37:07 - FindMyPhone] ActivityManager: Warning: Activity not started, its current task has been brought to the front
Your code isn't the problem, it's that the app is currently running on the emulator/device and Eclipse is trying to launch it again. Just hit back until you get to the home screen and try to launch it again.

Related

Logcat full of "Wtf, activity ActivityRecord" entries

I am getting thousands of the following warning message in my logcat, and it's crowding out the messages that I'm actually looking for:
W/ActivityManager﹕ Wtf, activity ActivityRecord{4338cd90 u0 us.bridgeses.Minder.debug/us.bridgeses.Minder.MainListActivity t269 f} in proc activity list not using proc ProcessRecord{4289a348 4821:us.bridgeses.Minder.debug/u0a246}?!?
Possibly related, my phone is now occassionally popping up the "Waiting for debugger process" dialog even when my phone is unplugged and the app is in the background. It only stops if I uninstall it, and starts up again the next time I debug. Any ideas?
Edit:
I just commented out my entire MainListActivity class. My app is now literally doing nothing except creating an empty Activity. I'm still getting tons of this message, and I'm still getting this message.
Edit 2:
This is getting really weird. I uninstalled the debug app, did not reinstall it, and I'm still getting this message.
This message comes from the Android OS. It happens when your activity is not destroyed correctly. Therefore the ActivityRecord is still there, but the corresponding proc is not. By rebooting, all records will lost, so you would not see any of these errors.
Typically this happens when a active/foreground activity component is being disabled. Such as calling packageManager.setComponentEnabledSetting() method to disable current active activity component.
I restarted my phone and the error has not recurred for 10 minutes. It's not really an answer, but I guess it's a resolution.

ADT Logcat Filters disappear and stop working

Sometimes when I'm using the ADT plugin for Eclipse my LogCat filters just disappear for no reason.
My problem is when I click on the [+] button to add a LogCat filter and type something in the Filter name field and my application name on the Application name field and I click OK, the filter does not work.
I have made sure that my application name is bee.mobile but it doesn't work, I tried to create a lot of filters in different ways with no success.
How I can solve this?
I had this problem too and it took several hours to solve. First you must End Task your ADB process from task manager and reopen eclipse again. Then add an error exception in your code intentional (like division by zero or somthing else). This make force logcat to show an error in the correct session not in the package name that you was adding into logcat. Do this methods and tell me if it not working. If LogCat shows error in session itself is better than you filter with package name. Sometime you have to run your Android Project 2 or more times with errors to force logcat shows your error. Unfortunately It seems big problem in Eclipse.

android activity class does not exists?

I have been developing a project in eclipse for an android app. An error which i frequently get is that of- activity class does not exist. But when i just save the manifest file once again the error vanishes and the program runs correctly. Why then do i get the same error again and again. ?
Console error:
[2011-11-18 15:08:38 - link] Starting activity acb.abc.LinkActivity on device emulator-5554
[2011-11-18 15:08:40 - link] ActivityManager: Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=acb.abc/.LinkActivity }
[2011-11-18 15:08:40 - link] New package not yet registered with the system. Waiting 3 seconds before next attempt.
[2011-11-18 15:08:40 - link] ActivityManager: Error: Activity class {acb.abc/acb.abc.LinkActivity} does not exist.
every time a new activity is added in the application, it needs to be added in the manifest file as well with a new tag.
Make sure that u r doing this otherwise the new activity will not be considered.
For reference see This
I got this problem today.
Attention that: "class {acb.abc/acb.abc.LinkActivity}",you should modify the AndroidManifest.xml, change acb.abc.LinkActivity to ".LinkActivity". Then will be OK.
You are not declairing your package name correctly in your manifest, thats what I guess. Either post your manifest or go through this discussion.
http://groups.google.com/group/android-developers/browse_thread/thread/ce62996fde2d4727
Cheers.....!!!!!!
In may case, in Android Studio, I changed AndroidManifest.xml like this: change main Activity on my custom Activity. Then I start my app on emulation device, I get:
"Error type 3 Error: Activity class {...} does not exist.",
and may app failed.
I was forced delete my app on virtual device (use Application Manager in device) and restarted app in Android Studio. This solution helped me.
I saw this error because I had installed my app as a built-in app, then disabled it to removed it. I thought I had removed it when I tried to run my app in eclipse as a "normal" app. I discovered that my app was still in system/app.
Once I removed it, I didn't see this error when running my app in Eclipse.
i had this problem too and it was because i had a second tag in my AndroidManifest.xml
on android studio <= 0.8.6 it was no problem
i'm not sure yet how to handle this if one needs two application's defined here
my use case was related to saving the application state in a separate activity
e.g.
http://blog.tomgibara.com/post/126377651/global-application-state-in-android
Error: Activity class {com.myapplication5.myapplication/com.myapplication5.myapplication.MainActivity} does not exist.
answer:
file-projectstructur-flavors-minsdk version =4
ok

Live wallpapers in android

i'm doing Android Live Wallpaper programmitically.I tried an example from http://www.codeproject.com/KB/Android/AndroidLiveWallpaper.aspx .WHen i run..i got error message on console as
"No Launcher activity found!
The launch will only sync the application package on the device!".How could i recover from this?
That's fine. Ignore the warning.
It's basically saying you can't start the 'activity' from the menu. But you don't have an activity you have a live wallpaper :-)
Just Long click the home screen > LiveWallapers > and you will see it installed here.

What is going on with the "Unexpected resume of <packagename> while already resumed" message on Android?

Several of my Android applications show the following type message in the logcat output:
I/UsageStats( 59): Unexpected resume of com.totsp.test while already resumed in com.totsp.test
In this case I created the default Hello World app by letting the ADT tool generate it, and it still gets this message. I am not doing anything special in onCreate and don't even have any other methods defined.
I realize this is an INFO level message, and it doesn't appear to hurt anything, but I was curious what was going on so I made a test application that keeps track of the onResume invocations. It is indeed re-resuming when this occurs. I'm wondering why this this occurs? While I haven't noticed a problem (other than these annoying log messages), it seems like it could be using more resources than necessary to do all this stuff an extra time.
I have searched and read a similar question here on SO, and the answer there seems dubious to me: Unexpected resume of "package name" while already resumed in ''package name" Error in Android. Specifically, no, you don't want to use android:configChanges="orientation" because that is just subverting the orientation tear down/resume, rather than fixing it. Even the documentation notes "this attribute should be avoided and used only as a last-resort" (http://developer.android.com/intl/de/guide/topics/manifest/activity-element.html#config).
Also I have seen thread in the Android dev group where Mr. Murphy says the "unexpected resume" is "benign": http://groups.google.com/group/android-developers/browse_thread/thread/567410dbfcc163c2.
I'll dig into the source when I get a chance, but I figured I would first just ask the all-knowing hivemind and see if someone already knows: why does this occur, and is it truly benign?
Don't worry about it, it is just a message from some internal state tracking that is not really a problem (hence it being INFO level). I'll make sure it is removed in the next platform version.
My whole Activity flow changes every time this error comes,
but i have handled this by adding android:configChanges="orientation" in the activity in Manifest File.
<activity android:name=".YourActivity" android:label="#string/app_name" android:configChanges="orientation" android:screenOrientation="nosensor">
Hope this helps you

Categories

Resources