Re: [android-developers] Re: Meta: Changes to new-user moderation policy

2016-09-09 Thread Streets Of Boston
>>> button click? If it's easy, I'll volunteer to be an admin just to help with >>> the spam. If a few other people did this too I bet we could have it down to >>> zero in no time. >>> >>> On Wednesday, August 31, 2016 at 1:18:44 PM UTC-4, Streets O

[android-developers] Re: Meta: Changes to new-user moderation policy

2016-08-31 Thread Streets Of Boston
Please, make this group moderated again or figure something out to weed out all the spam, rants and job-postings. This group has been basically useless. Finding actual questions to answer is near impossible. Posting your own question will get drowned out in a sea of spam a second later.

Re: [android-developers] Re: Android Studio + Kotlin + databinding = unused methods?

2016-05-17 Thread Streets Of Boston
n is simply less advanced in this area. > > On Mon, May 16, 2016 at 1:51 PM, Streets Of Boston <flying...@gmail.com > > wrote: > >> What about just disabling the Lint processing for this 'unused' issue? >> >> Click on the yellow warning and fix it by adding

[android-developers] Re: Android Studio + Kotlin + databinding = unused methods?

2016-05-16 Thread Streets Of Boston
What about just disabling the Lint processing for this 'unused' issue? Click on the yellow warning and fix it by adding a lint-disabling comment to the method. This will remove the warning. On Saturday, May 14, 2016 at 10:47:33 AM UTC-4, Mike Hurley wrote: > > Here are the versions I'm using: >

[android-developers] Re: (beginner question) variables reset when I change device orientation?

2016-04-12 Thread Streets Of Boston
Hint: Your Activity object is destroyed and then recreated on a rotation. This means that all your *new* Activity's fields have been set to 0/false/null again. Read the documentation about the `onSaveInstanceState(...)` method and how this stores data in the `savedInstanceState` parameter of

[android-developers] Re: listView get child items in a loop

2016-02-22 Thread Streets Of Boston
I assume your ListView has a ListAdapter (probably a BaseAdapter?). In your Adapter's getView(...) method, you have a position parameter. The position is the index into your array-list of data that you'd like to show in the correct list-item-view. You get your data-item from the Adapter given

[android-developers] Re: save web page login credentials via webview in android storage

2016-01-14 Thread Streets Of Boston
You should NEVER store the users credentials (password) in SharedPreferences or anywhere else for that matter. This is very un-secure. At best, use Android's *AccountManager* facilities. Back to your WebView question. The WebView of your app gets access to a cache where it can cache the

[android-developers] Re: JSON parsing in Android

2015-12-16 Thread Streets Of Boston
Looks like the server is sending the escape character "\" as well all over the place. This one needs to be removed basically everywhere, i.e. the server should send something like {"User":{"id":"5", "name":"Bob" ... ... ... "FirstYear"}} On Wednesday, December 16, 2015 at 6:11:36 PM UTC-5,

[android-developers] Re: how can I catch deadlock or hang of process?

2015-11-13 Thread Streets Of Boston
I don't know of an API that can help you figure out a deadlock for you. However, this is what I do to figure out the objects on which a deadlock occurs. -When the app deadlocks, attach the debugger (if it is not yet being debugged). -Then hit the Pause '||' button on the 'Debug' tab. -Then in

[android-developers] Re: handling data migration in android application upgradation

2015-11-05 Thread Streets Of Boston
Read this first https://developer.android.com/reference/android/database/sqlite/SQLiteOpenHelper.html In the onUpgrade helper you can execute SQL statements to add columns, add/alter tables, drop tables, etc., whatever your need is. Here is some more info

[android-developers] Re: Android Studio unit testing useless

2015-11-05 Thread Streets Of Boston
and don't need the emulator or > device to run the tests. I think you should check this out. Of course, > still somehow slow to build (due the gradle build), but the run of tests > should be very fast. > > -- > Paulo Morandi > > On Wednesday, November 4, 2015 at 12:53:

[android-developers] Re: Android Studio unit testing useless

2015-11-04 Thread Streets Of Boston
I never found TDD easy, or even feasible, using Android Studio or even Eclipse. Most projects' builds take too long to to TDD effectively. If you can't check your code and run your TDD tests within a few seconds of hitting the 'run-tests' button, it is useless... alas On Tuesday,

[android-developers] Re: android mediaplayer notification

2015-10-19 Thread Streets Of Boston
Take a look here: https://developer.android.com/reference/android/support/v4/media/session/MediaSessionCompat.html And google (or go to StackOverflow) "MediaSessionCompat" for more info if you get stuck. On Monday, October 19, 2015 at 7:20:23 AM UTC-4, Russell Harrower wrote: > > PLEASE HELP! I

Re: [android-developers] webview load page in background

2015-09-24 Thread Streets Of Boston
WebViews are only rendered if they are attached (to the Window) and if they are not 'View.GONE'. This means you have to add a WebView to your Activity's hierarchy somehow and either set it to View.INVISIBLE or set its alpha to 0 (make it transparent). There are 'optimizations' in the WebView

[android-developers] Re: Android Java Call getBytesFromFile() Fails

2015-09-11 Thread Streets Of Boston
The method *getBytesFromFile* is not a static method in *java.io.File* It is a static method in *com.compoze.util.IoUtility* On Friday, September 11, 2015 at 12:44:20 PM UTC-4, JediDroid wrote: > > I am using Android Studio and Oracle Java 8. I am trying to get all bytes > from a file and pass

[android-developers] Re: Android Studio NDK

2015-06-16 Thread Streets Of Boston
It is not (yet!) properly supported. But building your sources works well. Start here to figure out how. It helped me. http://ph0b.com/android-studio-gradle-and-ndk-integration/ On Tuesday, June 16, 2015 at 1:19:20 PM UTC-4, MB wrote: Hi, I would really if someone could tell me where one

[android-developers] Re: Receive Callback from Service

2015-04-22 Thread Streets Of Boston
Another option is to add a *ResultReceiver* ( https://developer.android.com/reference/android/os/ResultReceiver.html ) as a parameter to your AIDL function. This parameter can be used as a callback. The client (i.e. the one calling the AIDL function) will implement the parameter's

[android-developers] Re: Is it possible, that Android kills a service inside an app?

2015-01-06 Thread Streets Of Boston
Oleksi: What do you mean by 'killed'? Do you mean that its 'onDestroy' method gets called? Let's assume you are talking explicitly about starting the Service, not binding to it: If a Service is started by some other component, it needs to be explicitly stopped, either by the same component,

[android-developers] Re: Is it possible, that Android kills a service inside an app?

2015-01-06 Thread Streets Of Boston
Oleksi: What do you mean by 'killed'? Do you mean that its 'onDestroy' method gets called? Let's assume you are talking explicitly about starting the Service, not binding to it: If a Service is started by some other component, it needs to be explicitly stopped, either by the same component,

[android-developers] Re: Is it possible, that Android kills a service inside an app?

2015-01-06 Thread Streets Of Boston
Oleksi: What do you mean by 'killed'? Do you mean that its 'onDestroy' method gets called? Let's assume you are talking explicitly about starting the Service, not binding to it: If a Service is started by some other component, it needs to be explicitly stopped, either by the same component,

[android-developers] Re: onCharacteristicWrite Error Status 14

2014-12-09 Thread Streets Of Boston
I found this one here: https://android.googlesource.com/platform/external/bluetooth/bluedroid/+/android-4.3_r1.1/stack/include/gatt_api.h It seems 14 means GATT_ERR_UNLIKELY, whatever that is ... On Monday, December 8, 2014 11:34:30 PM UTC-5, Tony Pitman wrote: I am writing an Android app

[android-developers] Re: Creating a custom-view with rounded corners

2014-11-13 Thread Streets Of Boston
Simple solution: Use a FrameLayout and set the foreground drawable: https://developer.android.com/reference/android/widget/FrameLayout.html#setForeground(android.graphics.drawable.Drawable) The foreground drawable is drawn *over/on top of* the background and the children of a FrameLayout. If

[android-developers] Re: Tracking down multiple Activity instances in memory

2014-09-16 Thread Streets Of Boston
I had a similar issue once and I tracked it down to the View#setTag(int key, Object tag) method. In my code, setTag was called with a tag value being an object holding/referencing an instance that had children referring to children of the View on which this setTag was called (tag was a

[android-developers] Re: switch case using string from Enum

2014-07-18 Thread Streets Of Boston
Yep, you can't do that. If 'event' is of type 'Type', then you could do switch(event) { case TYPE_ONE: case TYPE_TWO: ...} ..., because Enum values are considered to be constant. Instead, change your switch statement to if (...) else if (...) { ... } else if (...) { ... } else if (...)

[android-developers] Re: switch case using string from Enum

2014-07-18 Thread Streets Of Boston
of the string instead of returning string? On Friday, July 18, 2014 1:22:45 PM UTC-4, Streets Of Boston wrote: Yep, you can't do that. If 'event' is of type 'Type', then you could do switch(event) { case TYPE_ONE: case TYPE_TWO: ...} ..., because Enum values are considered

[android-developers] Re: activity.getResoures()

2014-07-14 Thread Streets Of Boston
If 'res' is a local variable or a member/field of your activity, it's fine to use 'res' all over your method/activity. However, don't make res static/global (if you do and fail to set it to null at the appropriate time, you may set yourself up for memory leaks. Don't give it to other instances

[android-developers] Re: AndroidStudio - Wipe data between deploys

2014-06-16 Thread Streets Of Boston
There is, to my knowledge, no such thing as a 'wiping all data of my app' programmatically . However, you can program something similar yourself. Add a setting (SharedPreferences setting) to your app that stores the version-number of your app that the user is running. Upon start-up, read this

[android-developers] Re: Help with native exception: ScriptIntrinsicBlur.create() throws RSRuntimeException: Internal error: Object id 0

2014-05-28 Thread Streets Of Boston
Be sure to call 'destroy()' on your Renderscript rs variable when you're done with it (just before the 'return bm' statement). It wouldn't hurt to call 'destroy()' on the 'input' and 'ouput' variables as well when you're done with it. Try that and see if this fixes your problem. On Tuesday,

[android-developers] Re: ListView getCount is wrong - how do I reset it?

2014-05-19 Thread Streets Of Boston
It's bad programming practice, but you inherited it, so you need to deal with it.. :-) Question, though, and if this applies to your problem, you'll see why it is bad practices to make it static. Your ListActivity, does it have more than one instance? In other words, are there more than one

[android-developers] Re: ListView getCount is wrong - how do I reset it?

2014-05-19 Thread Streets Of Boston
Debug the listItems (ArrayList of Strings). Monitor its add method(s), i.e. set breakpoints on them, and figure out which code adds to this static list without notifying the ListAdapter(s). On Monday, May 19, 2014 9:53:44 AM UTC-4, plnelson wrote: I call if after adding each one mostly for

[android-developers] Re: position value in getView seems too big

2014-05-19 Thread Streets Of Boston
The ListAdapter's max value of the 'position' parameter of its getView(...) method is determined by the ListAdatper's getCount() method. It will never be larger than the value returned by getCount(): 0 = position getCount() I have never seen position being larger or equal than

[android-developers] Re: position value in getView seems too big

2014-05-16 Thread Streets Of Boston
That is hard to figure out without you posting the code of your adapter and how you create an instance of your adapter. It is probably a subtle bug... On Friday, May 16, 2014 2:34:19 PM UTC-4, plnelson wrote: Sorry - should be lv.get*Count*. And yes, I am calling notifyDataSetChanged.

[android-developers] Re: position value in getView seems too big

2014-05-15 Thread Streets Of Boston
There is no method 'getView' on a ListView class. And i expect i wouldn't return a number However, you do define a *static *field called *listItems*. Do you update the *listItems *field directly without notifying the your *BaseAdapter*? If so, this could be the problem. Notify the

[android-developers] Re: image not coming proper some times lazy loading grid view

2013-12-04 Thread Streets Of Boston
Not sure if this would work, but may be worth a try: Before you close the FileOutputStream 'fs', have you tried to call fs.getFD(),sync() ? On Wednesday, December 4, 2013 3:00:43 AM UTC-5, Amit Mangal wrote: Hi there, i am loading images on grid view using lazy loading from network. problem

[android-developers] Re: With Updated APK, Can't Purge Previous Data

2013-12-03 Thread Streets Of Boston
If your updated APK has its own SQLite database and your app uses a sub-class of SQLiteOpenHelper, you could increase your database version each time your update your app (increase version value in SQLiteOpenHelper constructor) and implement that sub-class' onUpgrade method to clear out data

[android-developers] Re: ViewPager does not respect WRAP_CONTENT?

2013-12-02 Thread Streets Of Boston
The ViewPager specified WRAP_CONTENT as its width. What content? The ViewPager can show more than one page and only one is visible at a time. If it had to choose the 'content' to use to figure out how wide the WRAP_CONTENT width should be, which page should it use? WRAP_CONTENT doesn't make

[android-developers] Re: does executable code change (improve) with increase in minSdkVersion declaration in manifest? is minsdk 11 declaration really needed for tablets?

2013-10-28 Thread Streets Of Boston
*minSdkVersion:* If this is less than the version you are compiling against, *you *have to take care with Java code (methods/classes/etc) that is defined in sdk-versions higher than the declared minSdkVersion. *You *have to deal with making your code somehow compatible with older sdk-versions.

[android-developers] Re: Is this OK ? (Triggering an event in an Activity from a Service)

2013-09-04 Thread Streets Of Boston
Yep, this is fine for a *local* Service. For a Service that could be remote, you'd need some other way of communicating (Service sending BroadCasts to a BroadCastReceiver in/of the Activity; ResultReceiver provided by the Acivity to the Service; AIDL; etc). On Wednesday, September 4, 2013

[android-developers] Re: What is the use of services in Android?

2013-08-08 Thread Streets Of Boston
For option 2, use an IntentSerrvice. Then you don't have to worry about calling 'stopService'. It does it for you when necessary. On Thursday, August 8, 2013 7:40:02 AM UTC-4, ashish wrote: I read about services in Android very carefully, but I didn't find any valid reasons to use it. E.g.

Re: [android-developers] What is the use of services in Android?

2013-08-08 Thread Streets Of Boston
Send another Intent (different action) to the IntentService. Override the onStartCommand to catch this Intent and this could allow you to stop/interrupt the ongoing process in the IntentService's background thread. On Thursday, August 8, 2013 2:04:33 PM UTC-4, ashish wrote: Hi, if a service

[android-developers] Re: GLSurfaceView lag/delay on Galaxy S3.

2013-08-01 Thread Streets Of Boston
Running out of ideas here :-) The test wasn't meant to see if Canvas would work or not. It was about the speed of the touch-event-message delivery. At least we figured out it isn't an issue with the onTouch callbacks. They happen fast enough. What happens if you play with the values of the

[android-developers] Re: GLSurfaceView lag/delay on Galaxy S3.

2013-07-31 Thread Streets Of Boston
Is your render-mode continuously or when-dirty? If it is when-dirty, be sure to call surfaceView.requestRender() in your onTouchEvent implementation. On Tuesday, July 30, 2013 7:14:22 AM UTC-4, Edvinas Kilbauskas wrote: The best solution to your problem is probably to bite the bullet and

[android-developers] Re: GLSurfaceView lag/delay on Galaxy S3.

2013-07-31 Thread Streets Of Boston
, Edvinas Kilbauskas wrote: 2013 m. liepa 31 d., trečiadienis 19:28:23 UTC+3, Streets Of Boston rašė: Is your render-mode continuously or when-dirty? If it is when-dirty, be sure to call surfaceView.requestRender() in your onTouchEvent implementation. It's RENDERMODE_CONTINUOUSLY. Also

[android-developers] Re: Handling process killed by system

2013-06-21 Thread Streets Of Boston
The singletons stick around as long as your process is alive. If your process is killed (and therefore your DalvikVM running your app), nothing sticks around, including your static variables/fields. This is just like any other Java/C/C++ app. The issue is that the OS kills your process, not

[android-developers] Re: Handling process killed by system

2013-06-21 Thread Streets Of Boston
Your app is stateful (state is carried over from Activity to Activity) and this is indeed an issue you'll run into. If you want to use a static variable (object) for your session state, you'll have to code your own persistence. E.g. Access your (global/static) state through a static method

[android-developers] Re: FragmentManager.popBackStack not working when used with child fragment manager

2013-05-28 Thread Streets Of Boston
Did a google search and wound up on stackoverflow, where Dianne Hackborn answered this question: http://stackoverflow.com/questions/8772921/how-to-pop-back-stack-for-activity-with-multiple-fragments In short: The backstack doesn't work for 'inner' fragments, it only works for Activity (i.e.

[android-developers] Re: Fragment state (and view) not restored when using ViewPager with nested fragments

2013-05-23 Thread Streets Of Boston
When using fragments inside a fragment, you should use the fragment's ChildFragmentManager and not the (activity's) main FragmentManager. On Thursday, May 23, 2013 9:12:31 AM UTC-4, Miha wrote: Hi! I'm using a ViewPager to swipe between screens. One of the fragments is composed of two

[android-developers] Re: Who's going to AnDevCon V? Discount available. . .

2013-05-10 Thread Streets Of Boston
I'll be there. How can i not be there, since I live in Boston. :) On Thursday, May 2, 2013 4:45:55 PM UTC-4, Nathan wrote: Who is going to AnDevCON in Boston this month? I will be there speaking at two sessions about Driving App Success. Much smarter people than me also are speaking there.

[android-developers] Re: Couldn't Create Directory for shared preferences

2013-05-10 Thread Streets Of Boston
Usually, this is a bug in the OS. Uninstalling and re-installing your app can make it go away. Google *android Could n't create Directory for shared preferences* and you'll find many links/answers/comments on your problem. On Friday, May 10, 2013 12:34:42 AM UTC-4, rahul wrote: Hi

[android-developers] Re: Who's going to AnDevCon V? Discount available. . .

2013-05-10 Thread Streets Of Boston
Of Boston wrote: I'll be there. How can i not be there, since I live in Boston. :) I'll try not to tread on you too heavily, Streets of Boston. You may have to mutate into human form for me to find you. Nathan -- -- You received this message because you are subscribed to the Google

[android-developers] Re: Intent confusion

2013-05-10 Thread Streets Of Boston
I guess the *Send For Signature *Activity is part of the Adobe Reader package/app *com.adobe.reader* as well. On Friday, May 10, 2013 2:17:05 PM UTC-4, bob wrote: I'm trying to understand Intents better. So I have this code to show a PDF: *String file_loc = /mnt/sdcard/mypdf.pdf;* *Uri dest

[android-developers] Re: What methods can be called after Activity.finish() is called?

2013-04-11 Thread Streets Of Boston
Any listener that listen to events happening on your Views in your Activity should cease to receive message-notifications as soon as the Activity and its Window (and View hierarchy) are destroyed. But if your code or some other code did a postDelayed on the main UI Looper, they will be

[android-developers] Re: reusing AsyncTaskLoader with always fresh data

2013-04-03 Thread Streets Of Boston
The call to getLoaderManager().initLoader(0, args, this); is enough to have your Loader run at least the first time it is created. Do *not *call 'startLoading()'. If you want to refresh your Loader's data call getLoaderManager().*restart*Loader(0, args, this); When initLoader or

[android-developers] Re: Activity won't start when launchmode is standard

2013-04-02 Thread Streets Of Boston
Maybe you could add one more log statement: Add a default constructor and print a log statement. This would check if the DGraphActivity instance is created or not: public DGraphActivity () { // Print out a log statement that this code here is reached properly. } If this constructor is

[android-developers] Re: Debugging the Activity life-cycle?

2013-03-29 Thread Streets Of Boston
Look at your logcat. It tells you when an activity hasn't started. For the onActivityResult getting called instantly: Your returning activity was probably started with a singleTask or singleInstance. This means that onActivityResult was called immediately after your activity was started (and

[android-developers] Re: Activity won't start when launchmode is standard

2013-03-29 Thread Streets Of Boston
Look at your logcat and see why your activity can't be started. Could be as simple as a typo in your manifest. On Friday, March 29, 2013 4:02:04 PM UTC-4, plnelson wrote: This question has (so far) stumped them on Stack Overflow. . . . I'm trying to launch an Activity which launches

[android-developers] Re: Activity won't start when launchmode is standard

2013-03-29 Thread Streets Of Boston
, 2013 5:57:46 PM UTC-4, Streets Of Boston wrote: Look at your logcat and see why your activity can't be started. Could be as simple as a typo in your manifest. I only see things in LogCat about DGraphActivity when it *does* start (ie., when its launchMode is singleInstance).Are you

[android-developers] Re: Activity won't start when launchmode is standard

2013-03-29 Thread Streets Of Boston
UTC-4, Streets Of Boston wrote: I've never seen this. If it fails to start, i get a logcat message and an exception is thrown (and you are catching that). Have you tried to set the Intent.FLAG_ACTIVITY_NEW_TASK flag when starting the activity? -- -- You received this message because you

[android-developers] Re: Seurity concern in Webview using javascript.

2013-03-27 Thread Streets Of Boston
As long as your WebView's HTML content doesn't load an external site, i.e. you control *all *the content shown in your WebView, there is no concern. However, if you make an app that becomes popular and has a WebView that can load external/public content, then someone could examine your app,

Re: [android-developers] Re: How to start again if some third party task killer has killed my app ?

2013-03-25 Thread Streets Of Boston
You haven't found it, because it doesn't exist :-) When the OS or a 3rd party app kills your process, it *kills* it forcefully. And if your app's process is killed your app no longer runs and obviously can't process any callbacks/lifecycle-events, etc. On Sunday, March 24, 2013 3:47:17 AM

Re: [android-developers] Re: Concurrency: Do you use Loaders? AsyncTask? or Runnables?

2013-03-21 Thread Streets Of Boston
Micinski krismi...@gmail.comjavascript: wrote: Ah that's right, forgive my comment. On Mar 20, 2013 12:03 PM, Streets Of Boston flying...@gmail.comjavascript: wrote: The onStart/onStartCommand methods of a *Service *run in the main UI thread, not a background thread, But an *IntentService

[android-developers] Re: Concurrency: Do you use Loaders? AsyncTask? or Runnables?

2013-03-20 Thread Streets Of Boston
There are even more ways of doing stuff in the background: IntentService :-) - Runnable If you mean a Thread (running itself or a Runnable): Generally, avoid using them. But there are good use cases: When you want to setup something that runs in the background for a long time

Re: [android-developers] Re: Concurrency: Do you use Loaders? AsyncTask? or Runnables?

2013-03-20 Thread Streets Of Boston
11:06:05 AM UTC-4, Kristopher Micinski wrote: Though it's worth noting that since an `IntentService` doesn't run in a background thread context. (Probably one of the biggest things beginners screw up..) Kris On Wed, Mar 20, 2013 at 9:49 AM, Streets Of Boston flying...@gmail.com

[android-developers] Re: How to get device raw width and height or actual screen width and height ?

2013-03-08 Thread Streets Of Boston
For any API-level less than 17, use the snippets of code you are using successfully now. For API-level 17 and higher (your Nexus 7 running 4.2), use this: https://developer.android.com/reference/android/view/Display.html#getRealSize(android.graphics.Point) On Monday, November 19, 2012 6:29:14

Re: [android-developers] Can this variable become null?

2013-02-25 Thread Streets Of Boston
In addition to Treking's answer; Never rely on the order in which (you think that) activities are started to initialize or modify static/global data. E.g. User goes through your app, starting from the homescreen, going from Activity A then to Activity B then to C. This could be order in which

[android-developers] Re: Avoiding the dreaded ANR background work

2013-02-25 Thread Streets Of Boston
Does your receiver handle the JSON update (i.e. it goes out to the server, retrieves the updated json from the server and notifies the registered activities)? If so, this is not correct. BroadcastReceivers should never ever do long running tasks. Instead, your BroadcastReceiver should receive

[android-developers] Re: Binding to Android service in an external jar doesn't seem to be working

2013-02-11 Thread Streets Of Boston
Maybe this service class uses/loads other classes that fail to load. Strong candidates that may fail to load are R. classes and their members: If your JAR is generatedfrom a library project and if you distribute just the JAR file, you may not distribute any R. classes along with it,

[android-developers] Re: Daemon Threads in Android

2013-02-07 Thread Streets Of Boston
I agree; Unless your code creates the threads/thread-pools, i.e. if your code doesn't own these threads, avoid calling 'setDaemon(...)'. On Wednesday, February 6, 2013 8:08:47 PM UTC-5, Nathan wrote: On Wednesday, February 6, 2013 4:52:00 PM UTC-8, Streets Of Boston wrote: It's mostly

Re: [android-developers] ydpi != xdpi

2013-02-06 Thread Streets Of Boston
Just look here: http://developer.android.com/reference/android/util/DisplayMetrics.html#density On Wednesday, February 6, 2013 10:35:52 AM UTC-5, bob wrote: Can you please rephrase what you are saying here? I can't understand it. Part of the issue is that a lot of code relies on the

[android-developers] Re: Daemon Threads in Android

2013-02-06 Thread Streets Of Boston
It's mostly just 'ported' from regular Java, where a process could not do a normal 'exit' when non-daemon thread were still running. But you're right. It would seem that if android decides to 'kill' your app, it doesn't much matter whether there are some daemon threads still running or not.

Re: [android-developers] Re: asynctask vs. FragmentRetainInstance.java in API demo

2013-02-05 Thread Streets Of Boston
, such as a button click event. I could not figure out another way but only adding the same fragment to my activity. It is why I am concerned about adding multiple UI-less fragements to my activity. Is there another way to do so? 2013/2/5 Streets Of Boston flying...@gmail.com javascript

[android-developers] Re: startActivity

2013-02-04 Thread Streets Of Boston
If you want to start one activity (screen) and report a result back to the calling activity (screen) you need the handle of the calling activity. No way around it. If you are not worried about reporting a result back, you can get hold of the Application Context

Re: [android-developers] Re: asynctask vs. FragmentRetainInstance.java in API demo

2013-02-04 Thread Streets Of Boston
threads to the UI and why it tries to stop the thread in both onDestroy() and onDetach(). 2013/2/1 Streets Of Boston flying...@gmail.com javascript: After your Fragment, the one without a UI, has started the AsyncTask, i.e. after the AsyncTask's 'execute' method has been called, it can stop

[android-developers] Re: Sending messages to Activity UI thread

2013-02-04 Thread Streets Of Boston
This is one way of doing it (as long as simHandler was created on UI thread). However, this is too much work. Just call simHandler.postDelayed on the simHandler itself; no need to create a separate thread: See documentation here:

[android-developers] Re: Sending messages to Activity UI thread

2013-02-04 Thread Streets Of Boston
Yes, you can. Use a WeakReference to your activity. static class MyHandler extends Handler { private WeakReferenceMyActivity activityRef; public MyHandler(MyActivity activity) { activityRef = new WeakReferenceMyActivity(activity); } /** * @return The activity for which this MyHandler was

[android-developers] Re: startActivity

2013-02-04 Thread Streets Of Boston
for Activity, and didn't realize it was an * override*. On Monday, February 4, 2013 11:07:08 AM UTC-6, Streets Of Boston wrote: If you want to start one activity (screen) and report a result back to the calling activity (screen) you need the handle of the calling activity. No way around

[android-developers] Re: Sending messages to Activity UI thread

2013-02-04 Thread Streets Of Boston
Yep, but you risk a memory leak of your activity, because the Handler (being tied to the UI thread which will stick around for a long time) is not tied to the life-cycle of your Activity. On Monday, February 4, 2013 2:09:35 PM UTC-5, skink wrote: Streets Of Boston wrote: Yes, you can

[android-developers] Re: asynctask vs. FragmentRetainInstance.java in API demo

2013-02-01 Thread Streets Of Boston
After your Fragment, the one without a UI, has started the AsyncTask, i.e. after the AsyncTask's 'execute' method has been called, it can stop it by calling 'cancel' on it. task.execute(...); ... ... And on some event, (Fragment's onDestroy for example), you just call.

[android-developers] Re: Create bitmap from view but keep view

2013-01-25 Thread Streets Of Boston
Replied to it on StackOverflow. On Wednesday, January 23, 2013 9:24:09 PM UTC-5, Caio Ricci wrote: I found two ways of creating a Bitmap from a view. But once I do that, the view disappears and I can't use it anymore. How can I redraw the view after generating my bitmap? Please check the

Re: [android-developers] Re: Application.onCreate Method Randomly Called?

2013-01-18 Thread Streets Of Boston
*SharedPreferences are persistent, assuming that you use commit() or apply(). * Be mindful, though, when different parts of your app are running on different processes: If you change some SharedPreferences settings and call 'commit()' in one process, these changes are not immediately available

[android-developers] Re: Passing an object as extras in intent

2013-01-18 Thread Streets Of Boston
If the intent crosses process boundaries and you wrote your own Parcelable, be sure to set the ClassLoader on the Bundle (which represents all the Extras in an Intent) before you read the content of the Intent. getIntent().getExtras().setClassLoader(getClass().getClassLoader()); On Friday,

[android-developers] Re: Passing an object as extras in intent

2013-01-18 Thread Streets Of Boston
If your object crosses different packages, look at this post: http://stackoverflow.com/questions/5743485/android-resultreceiver-across-packages On Friday, January 18, 2013 10:04:11 AM UTC-5, Streets Of Boston wrote: If the intent crosses process boundaries and you wrote your own Parcelable

[android-developers] Re: SyncAdapter and multiple threads?

2013-01-17 Thread Streets Of Boston
The answer is right here in the documentation: https://developer.android.com/reference/android/content/AbstractThreadedSyncAdapter.html#onPerformSync(android.accounts.Account, android.os.Bundle, java.lang.String, android.content.ContentProviderClient, android.content.SyncResult) *...

[android-developers] Re: SyncAdapter and multiple threads?

2013-01-17 Thread Streets Of Boston
The answer is right here in the documentation: https://developer.android.com/reference/android/content/ AbstractThreadedSyncAdapter.html#onPerformSync(android.accounts.Account, android.os.Bundle, java.lang.String, android.content.ContentProviderClient, android.content.SyncResult) *...

Re: [android-developers] Correct way to implement Activity onDestroy()?

2013-01-14 Thread Streets Of Boston
An Activity's onDestroy is called all the time (but not every time :)). It is true that you can't *rely *on it being called, though. E.g. the onDestroy is always called when you click the 'back' key or do some other action (code-execution) that causes the Acitivity's 'finish()' method to be

[android-developers] Re: debug blues

2013-01-10 Thread Streets Of Boston
Yes. The code on the device (Nexus 7) has debug info that tells Eclipse the line-numbers of the source-code. If your source-code (android-16) is out-of-date, these line-number don't match up and Eclipse shows you something wrong (correct line-number, wrong source-version). On Thursday,

[android-developers] Re: MemoryFile - ParcelFileDescriptor

2013-01-10 Thread Streets Of Boston
Why are you using a MemoryFile? If you need to read the file into memory, you could just use a byte[] and byte-arrays are parcelable. Actually, I'd suggest not reading it into memory a all and just pass the 'Uri uri' from the parcelable producer to the consumer and the consumer can read the

[android-developers] Re: MemoryFile - ParcelFileDescriptor

2013-01-10 Thread Streets Of Boston
Why are you using a MemoryFile? If you need to read the file into memory, you could just use a byte[] and byte-arrays are parcelable. Actually, I'd suggest not reading it into memory a all and just pass the 'Uri uri' from the parcelable producer process to the consumer process and the consumer

[android-developers] Re: How to avoid useless getView in GridView

2013-01-08 Thread Streets Of Boston
It probably has something to do with the scrap-head, where recycled views are stored. I wouldn't worry about it too much. On Monday, January 7, 2013 11:57:04 PM UTC-5, William Guy wrote: I have tested GridView behavior in getView() , and i got: 01-08 11:18:55.925: E/getView(4113): Position:

[android-developers] Re: How to avoid useless getView in GridView?

2013-01-08 Thread Streets Of Boston
See my answer in your earlier question in this group. On Tuesday, January 8, 2013 12:04:38 AM UTC-5, William Guy wrote: I have tested GridView behavior in getView, and i got: 01-08 11:18:55.925: E/getView(4113): Position: 0, Child Count: 0, ConvertView: Null 01-08 11:18:55.945:

[android-developers] Re: terminating android application

2013-01-03 Thread Streets Of Boston
First of all: Why? Secondly: If your process is killed (through a 'kill' command issued, through System.exit or Process.killProcess), the OS may restart it (like you see sometimes when your app crashes and is starting up immediately again with the previous Activity). Also, and this depends on

[android-developers] Re: Wake locks android

2012-12-05 Thread Streets Of Boston
In addition to acquiring a partial wake-lock, try to make your service a foreground service. This causes the service to be considered a foreground process and it shows the user a notification on the notification bar. See the method Service#startForeground(int id, Notification not) in the

[android-developers] Re: thread life

2012-11-30 Thread Streets Of Boston
Yes. Threads are alive as long as they run and are not at all associated with an Activity's (or any other object's) life-cycle. This is also one of the main reason why it is dangerous to create sub-classes of Thread that are (anonymous) non-static inner classes, where the outer class is an

[android-developers] Re: extend class and constructors

2012-11-29 Thread Streets Of Boston
public class Derived extends base { public Derived() { super(); } public Derived(int iVal) { super(iVal); } } On Thursday, November 29, 2012 12:34:56 PM UTC-5, Simon Giddings wrote: This may seem a bit basic, but I come from a C++ background and it is

[android-developers] Re: Write to another application's internal memory

2012-11-28 Thread Streets Of Boston
You can't do that. If you want 2 separate apps (i.e. apps with a different package name and therefore different user-ids) to share data, you'd have to device other measures: 1. Write your own ContentProvider that is public/exported.

[android-developers] Re: Convert a view (layout) to a Bitmap

2012-11-19 Thread Streets Of Boston
I'm not sure if this will work in your situation, but try calling setWillNotCacheDrawing this on the View 'l' as well: boolean drawsCache = l.willNotCacheDrawing(); l.setWillNotCacheDrawing(false); Bitmap dragPicture = Bitmap.createBitmap(l.getDrawingCache());

Re: [android-developers] Convert a view (layout) to a Bitmap

2012-11-19 Thread Streets Of Boston
Hi Justin, While I do agree that people should not post/answer just anything that they have no clue about, you may want to put your foot into your mouth when you realize who Romain is :-) On Saturday, November 17, 2012 3:18:27 PM UTC-5, Justin Buser wrote: I don't understand why I keep

[android-developers] Re: Starting with Loaders, Beginner Questions

2012-11-15 Thread Streets Of Boston
Some quick answers to your questions :) 1. I use loaders mainly in fragments. Since fragments can be retained across configuration changes (setRetainInstance(true)), loaders tied to these fragments are retained across configuration changes as well. Also, delivery to your UI when data has been

[android-developers] Re: Starting with Loaders, Beginner Questions

2012-11-15 Thread Streets Of Boston
reduces the memory leak of an activity. should read reduces the *risk of a *memory leak of an activity. On Thursday, November 15, 2012 9:47:25 AM UTC-5, Streets Of Boston wrote: Some quick answers to your questions :) 1. I use loaders mainly in fragments. Since fragments can be retained

[android-developers] Re: AsyncTask design question

2012-11-14 Thread Streets Of Boston
Create a separate AsyncTask subclass for each different task that needs to be done. It is bad Java design to create one large AsyncTask subclass that handles everything in your app. That would mean you'd have to create a large 'doInBackground' method (being able to handle all cases), possibly

  1   2   3   4   5   6   7   8   9   10   >