[android-developers] Re: Changing view pager view set causes app to crash.

2012-03-12 Thread tatebn
Added this to the view pager adapter. Good to go now. public int getItemPosition(Object object) { return POSITION_NONE; } On Mar 12, 2:00 pm, tatebn wrote: > I've stopped the crashing by making sure notifyDataSetChanged is > called in a handler on the main thread.  But the curre

[android-developers] Re: Changing view pager view set causes app to crash.

2012-03-12 Thread tatebn
I've stopped the crashing by making sure notifyDataSetChanged is called in a handler on the main thread. But the current web view doesn't go away. Other pages show up as their supposed to, but the current one is never replaced. On Mar 9, 5:07 pm, tatebn wrote: > I'm using a

[android-developers] Changing view pager view set causes app to crash.

2012-03-09 Thread tatebn
I'm using a ViewPager with the android support library to load static html pages into webviews and flip through them similar to a magazine app. I can load the initial page fine, which is using loadContentId(). When the user clicks on a link I'm calling the same loadContentId() method. When I call

[android-developers] Re: Using ViewPager with dynamic view sets

2012-03-09 Thread tatebn
Sorry, I'm pretty new to android myself. I don't think I can be much help to you on that. On Feb 10, 1:09 pm, Adi wrote: > @tatebn - Hi, I desperately needed this post! But as yours seems to be > an internal web view, mine is an external file on the SD-Card. I'm > tryi

[android-developers] Re: Passing ArrayList in BroadcastReceiver in Android

2012-03-02 Thread tatebn
2, 2:13 pm, tatebn wrote: > What's confusing to me is that it actually gets an ArrayList. > It's just been emptied out somehow. > > On Mar 2, 1:25 pm, tatebn wrote: > > > > > > > > > Accidentally left that prefix in the code there.  That's not the iss

[android-developers] Re: Passing ArrayList in BroadcastReceiver in Android

2012-03-02 Thread tatebn
What's confusing to me is that it actually gets an ArrayList. It's just been emptied out somehow. On Mar 2, 1:25 pm, tatebn wrote: > Accidentally left that prefix in the code there.  That's not the issue > in the actual app. > > On Mar 2, 1:17 pm, tatebn wrote:

[android-developers] Re: Passing ArrayList in BroadcastReceiver in Android

2012-03-02 Thread tatebn
Accidentally left that prefix in the code there. That's not the issue in the actual app. On Mar 2, 1:17 pm, tatebn wrote: > It's the intent in the broadcast receiver's onReceive message > > /** Handler for content ids updated. */ > private BroadcastReceiv

[android-developers] Re: Passing ArrayList in BroadcastReceiver in Android

2012-03-02 Thread tatebn
LocalBroadcastManager.getInstance(this).registerReceiver(mContentIdsUpdated, new IntentFilter(Common.ContentIdsUpdatedNotification)); On Mar 2, 12:15 pm, Mark Murphy wrote: > Are you sure you are looking at the right Intent? > > > > > > > >

[android-developers] Passing ArrayList in BroadcastReceiver in Android

2012-03-02 Thread tatebn
I'm using LocalBroadcastManager to send data between classes. I'm trying to send an ArrayList of String objects, 1 dimensional, in one of them. The array has all my strings when I send it, but on the receiving end it is empty. Has anyone seen this before? Here's my code. Send Message (I can prin

[android-developers] Trouble Skinning Options Menu Item

2012-02-17 Thread tatebn
I'm trying to skin the options menu on android. I have the background color changed with a custom theme, but I can't get the text color to change for some reason. My Theme @color/ optionsMenuBackgroundColor

[android-developers] Re: Using ViewPager with dynamic view sets

2012-02-08 Thread tatebn
is.contents.indexOf(tmp); } } this.notifyDataSetChanged(); } } On Feb 7, 12:13 am, HeneryH wrote: > tatebn, did you ever solve this problem?  I have been going crazy trying to > dynamically add views to a view

[android-developers] Use javascript to get web view selection.

2012-02-01 Thread tatebn
I need to run some javascript in an android web view. I understand this works fine by loading a javascript: url. It seems that when I do that though the selected text in the web view is cleared. The javascript I'm running gets the range of the selected text, so I need it to remain selected. I have

[android-developers] Creating a context menu similar to gmail app.

2012-01-20 Thread tatebn
I need to create a context menu similar to the menu that pops up in the gmail app. I need this menu to show up when I select text in a web view. I found this tutorial on quick action bars, http://www.londatiga.net/it/how-to-create-quickaction-dialog-in-android/ and it looks straight forward enoug

[android-developers] Re: Problem evaluating javascript with a semaphore lock

2012-01-18 Thread tatebn
Ok. I got it. And I feel a little bit stupid. I have multiple url schemes I'm using within the app to do things like send analytics, etc. One of those schemes is "finishedloading://", which tells me that the page is ready for me to inject javascript. In my shouldOverrideMethod, if (uri.getSchem

[android-developers] Re: Problem evaluating javascript with a semaphore lock

2012-01-18 Thread tatebn
Nevermind. Looks like loadUrl() is being loaded in the main thread. And setValue() is being called in the WebViewCoreThread. On Jan 18, 2:12 pm, tatebn wrote: > The javascript is actually generated in the getJSValue method.  For > this test I'm using "2 + 2" as my expressi

[android-developers] Re: Problem evaluating javascript with a semaphore lock

2012-01-18 Thread tatebn
The javascript is actually generated in the getJSValue method. For this test I'm using "2 + 2" as my expression. So I don't think the actual js is the issue. How do I tell which thread which method call is happening in? On Jan 18, 1:20 pm, Streets Of Boston wrote: > Very odd. > > The call to

[android-developers] Re: Problem evaluating javascript with a semaphore lock

2012-01-18 Thread tatebn
Thanks, but I have the javascript to java binding working. My issue is that I need to wait and return the value set via that binding from javascript. But it seems that the loadUrl() method in the web view isn't using it's own thread. So any waiting I'm doing stops the javascript from executing.

[android-developers] Re: Problem evaluating javascript with a semaphore lock

2012-01-18 Thread tatebn
Nevermind that. Misread the log. The latch.await times out every time. But the javascript is not evaluated until after the timeout. On Jan 18, 12:21 pm, Streets Of Boston wrote: > It's from a separate class (runJS does something like > mWebView.loadUrl(javaScriptUrl);) > > In my sample code, t

[android-developers] Re: Problem evaluating javascript with a semaphore lock

2012-01-18 Thread tatebn
My getJSValue() is run on the main thread as well. As far as the latch.await goes, If I run webView.loadUrl() in an asyncTask I get the full time out (10 seconds for testing). If I just run webView.loadUrl() in the current task, there is no time out. The latch.await call instantly comes back, but

[android-developers] Re: Problem evaluating javascript with a semaphore lock

2012-01-18 Thread tatebn
I've tried executing the javascript in an async task, which I thought would fix any threading issues. But I get the same issue. How do you have your threads specified when you run yours? Are you running this from a WebView subclass or from a separate class for you javascript interface? I've tri

[android-developers] Re: Problem evaluating javascript with a semaphore lock

2012-01-18 Thread tatebn
mply within JS make of your page a throbber and only swap it > back to its actual content as a last statement in the JS function that > you want to process. > > On 18 January 2012 16:24, tatebn wrote: > > > > > > > > > > > I'm getting the sam

[android-developers] Re: Problem evaluating javascript with a semaphore lock

2012-01-18 Thread tatebn
I'm getting the same issue using the CountDownLatch. The WebView can't load the url because of the lock. On Jan 18, 11:01 am, Streets Of Boston wrote: > We use a countdown latch instead: > > String returnValue; > private CountDownLatch latch = null; > > public String run(String javaScript, int

[android-developers] Re: Problem evaluating javascript with a semaphore lock

2012-01-18 Thread tatebn
uating when the semaphore is locked. I've tried running the javascript evaluation code in an async task as well, still no lock. On Jan 18, 10:32 am, Daniel Drozdzewski wrote: > Why can't you just let webview evaluate the JavaScript? > > On 18 January 2012 15:18, tatebn wrote

[android-developers] Re: Problem evaluating javascript with a semaphore lock

2012-01-18 Thread tatebn
ough, in which case you have to > release first. > > Either change the parameter to Semaphore constructor or release before > calling Semaphore.acquire() > > Daniel > > On 18 January 2012 15:00, tatebn wrote: > > > > > > > > > > > By the way,

[android-developers] Re: Problem evaluating javascript with a semaphore lock

2012-01-18 Thread tatebn
By the way, this code is located in a subclassed WebView. On Jan 18, 9:53 am, tatebn wrote: > I'm trying to evaluate javascript with a semaphore lock.  I need to > query some web content about which context menus to show and need it > to be synchronous.  When I try to acquire the

[android-developers] Problem evaluating javascript with a semaphore lock

2012-01-18 Thread tatebn
I'm trying to evaluate javascript with a semaphore lock. I need to query some web content about which context menus to show and need it to be synchronous. When I try to acquire the semaphore the thread locks without the javascript being evaluated and my javascript interface method being called.

[android-developers] Re: Using ViewPager with dynamic view sets

2011-12-27 Thread tatebn
based on position. On Dec 27, 3:35 pm, TreKing wrote: > On Tue, Dec 27, 2011 at 2:10 PM, tatebn wrote: > > I don't see add and remove items. > > Try the official docs instead of some random open source > project.http://developer.android.com/reference/an

[android-developers] Re: Using ViewPager with dynamic view sets

2011-12-27 Thread tatebn
, 12:43 pm, TreKing wrote: > On Tue, Dec 27, 2011 at 10:49 AM, tatebn wrote: > > I've looked at the ViewPager examples which look like it uses an adapter > > which has a defined number of pages. > > A brief look at the PageAdapter shows methods for adding and removing >

[android-developers] Using ViewPager with dynamic view sets

2011-12-27 Thread tatebn
I'm trying to use ViewPager to allow the user to flip through a series of web views. I've looked at the ViewPager examples which look like it uses an adapter which has a defined number of pages. The problem I have is that the number of pages I have changes regularly. Is there not a way to just u

[android-developers] Re: Loading internal html content in android web view

2011-12-06 Thread tatebn
Scratch this. I got it working by using a URI (all caps) URI fileUri = URI.create(filePath); to create the file. The blank web view content was because the unzipped files were empty. On Dec 6, 10:01 am, tatebn wrote: > I'm trying to load internal content in an android web view. The &

[android-developers] Re: Loading internal html content in android web view

2011-12-06 Thread tatebn
I can get it to recognize the file's existence if I remove the file:// from the front of the path. But then the web view loads a blank white page. On Dec 6, 10:01 am, tatebn wrote: > I'm trying to load internal content in an android web view. The > content is in a content direc

[android-developers] Loading internal html content in android web view

2011-12-06 Thread tatebn
I'm trying to load internal content in an android web view. The content is in a content directory that's been unzipped into the app's files directory. I can verify that the files are there by using the adb shell. However I keep getting an error in the web view that the file doesn't exist. I'm using

[android-developers] Re: Cross Activity Listeners

2010-09-14 Thread tatebn
Thanks, was actually just about to post that. Sorry for all the little questions. One of these days I'll get this crazy Android stuff. On Sep 14, 2:14 pm, Mark Murphy wrote: > On Tue, Sep 14, 2010 at 1:45 PM, tatebn wrote: > > I've stumbled on a new, related issue.  O

[android-developers] Re: Cross Activity Listeners

2010-09-14 Thread tatebn
I've stumbled on a new, related issue. One of the tabs is a mapview. How do I work with that? I get an error having a mapView outside of a mapActivity. Since I'm obviously extending TabActivity here, how do I get a map in one of these tabs? On Sep 14, 1:35 pm, tatebn wrote: >

[android-developers] Re: Cross Activity Listeners

2010-09-14 Thread tatebn
Nevermind, I think I got it as per your examples. Thanks. On Sep 14, 1:22 pm, tatebn wrote: > I tried using the set content with the view. > > spec = tabHost.newTabSpec("albums").setIndicator("List", > > res.getDrawable(R.d

[android-developers] Re: Cross Activity Listeners

2010-09-14 Thread tatebn
#x27;t create the view content because it can't find the view with id "whatever". What am I doing wrong here? Thanks On Sep 14, 11:37 am, tatebn wrote: > Can you point me to an example of how to do that?  Currently I'm > creating a new intent with the activity class and se

[android-developers] Re: Cross Activity Listeners

2010-09-14 Thread tatebn
rent implementation. > > On Tue, Sep 14, 2010 at 11:24 AM, tatebn wrote: > > Can I have one Activity listen for a message from another?  I have a > > TabActivity and I need to call a function/send a message to the > > associated tabs.  How do I go about doing that? > >

[android-developers] Cross Activity Listeners

2010-09-14 Thread tatebn
Can I have one Activity listen for a message from another? I have a TabActivity and I need to call a function/send a message to the associated tabs. How do I go about doing that? -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to

[android-developers] GeoCoding Problems

2010-09-09 Thread tatebn
I'm trying to use the GeoCoder to get the lat/lon for a couple of addresses. I'm running into an error where the address list comes back empty sometimes. It seems to be completely random. I have a start point and an end point to draw and route. Sometimes I can't get either one, sometimes I can

[android-developers] Getting variables from tab activity in the child activities

2010-09-08 Thread tatebn
If I have a tab activity with multiple tabs, each containing a different activity, is it possible to have a variable in the tab activity and access it from the child activities? How would I do that? -- You received this message because you are subscribed to the Google Groups "Android Developers"

[android-developers] Maps with directions.

2010-09-07 Thread tatebn
Is it possibly to have a button in my app that switches to the phone's Maps application while passing in a destination for directions? And how would I do that? Haven't been able to find anything about it. Thanks -- You received this message because you are subscribed to the Google Groups "Andr

[android-developers] Re: Smoothing out a line on a canvas.

2010-09-07 Thread tatebn
Perfect, thanks. On Sep 3, 2:40 pm, Romain Guy wrote: > Turn on antialiasing on the Paint used to draw the lines. > > > > On Fri, Sep 3, 2010 at 11:12 AM, tatebn wrote: > > I'm trying to draw out a race track in a map overlay.  I have a series > > of locations th

[android-developers] Smoothing out a line on a canvas.

2010-09-03 Thread tatebn
I'm trying to draw out a race track in a map overlay. I have a series of locations that define the track. I have the drawing working fine just using canvas.drawLine() from one point to the next. But, understandably, this looks kind of choppy. Is there a decent way to smooth the line out? -- Y

[android-developers] ListView listener problems

2010-08-30 Thread tatebn
I'm using a ListAction and I'm having some trouble with my listeners. I'm using onListItemClick to catch any item clicks, which works fine unless I add an OnLongClickListener to the list items. In that case the long click works but the short click doesn't register. I've tried adding an OnClickLis

[android-developers] Re: Searching in a tab

2010-08-25 Thread tatebn
When I change the launch mode to singleInstance, it no longer pushes the the new intent on top, but the search intent fills the screen on search and covers the tabs. On Aug 25, 3:09 pm, tatebn wrote: > I have a tab host with two tabs.  I want one of those tabs to be a > search screen

[android-developers] Searching in a tab

2010-08-25 Thread tatebn
I have a tab host with two tabs. I want one of those tabs to be a search screen. The content for the tab is a ListActivity. I'm pulling the content from a web service. My problem is, when I execute the search a new intent is pushed onto the screen. I've used the android:launchMode="singleTop"

[android-developers] Re: Database transaction help needed.

2010-08-24 Thread tatebn
Damevin" написал: > > Hi, > > Do you call getWriteableDatabase twice ? because you shouldn't. > It should be the same SQLiteDatabase object or you have to end the > transaction from the first one before you start a new one. > > Kim > > On Tue, Aug 24, 2010 at

[android-developers] Database transaction help needed.

2010-08-24 Thread tatebn
I'm using transactions to insert data into several tables with foreign key relationships. Basically I have a wrapper for each table. Each wrapper creates it's own SQLiteOpenHelper and holds onto the SQLiteDatabase that comes from the getWriteableDatabase() call. Now here's the problem, When I i