[android-developers] how to capture back key event for Popup window

2010-02-09 Thread elephantbug
hi,

I have one pop up window which will be launched when user click on an
image view. And I notice when I clicks back key, the pop up window
will disappear.

My question is where this pop up window goes, it it destroyed?

How can I intercept the back key event and do something?

Thanks.

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] [urgent]Quick Contact Tack Implementation

2010-01-28 Thread elephantbug
Hi,

I would like to implement the similar widget as QuickContactBadge from
which I can launch some internal activities.

I checked out the source code for QuickContactBadge,
QuickContactActivity etc and simplified them to accommodate our
requests. It can launch and display at correct position.

However, I can not see the original view below the quick contact tack
no matter how I try. And I found the window created by
QuickContactWindow is quite small and I tried to set the background
etc. Nothing works.

Who can help or give some guidance about how window works?

Say, from Activity A, I click on image, I launch a new activity (or
window), how can I make the Window of Activity A is still visible?

Or more general, what is the best way to achieve similar behavior like
QuickContactBadge?

Thanks in advance.

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Out Of Memory issue

2008-12-08 Thread elephantbug

Hi,

Our application sometimes runs out of memory, especially on the map
view. Below it the exception we got, anyone can give any hint about
what might be the cause? Is there any known issue about MapView?

W/System.err(  193): OutOfMemory
E/MapView (  193): IllegalStateException on drawMap. Wiping cache.
E/MapView (  193): java.lang.IllegalStateException: null image
E/MapView (  193):  at com.google.googlenav.map.MapTile.getImage
(Unknown Source)
E/MapView (  193):  at com.google.googlenav.map.Map.a(Unknown
Source)
E/MapView (  193):  at com.google.googlenav.map.Map.drawMap
(Unknown Source)
E/MapView (  193):  at com.google.android.maps.MapView.drawMap
(MapView.java:996)
E/MapView (  193):  at com.google.android.maps.MapView.onDraw
(MapView.java:442)
E/MapView (  193):  at android.view.View.draw(View.java:5326)
E/MapView (  193):  at android.view.ViewGroup.drawChild
(ViewGroup.java:1420)
E/MapView (  193):  at android.view.ViewGroup.dispatchDraw
(ViewGroup.java:1192)
E/MapView (  193):  at android.view.ViewGroup.drawChild
(ViewGroup.java:1418)
E/MapView (  193):  at android.view.ViewGroup.dispatchDraw
(ViewGroup.java:1192)
E/MapView (  193):  at android.view.ViewGroup.drawChild
(ViewGroup.java:1418)
E/MapView (  193):  at android.view.ViewGroup.dispatchDraw
(ViewGroup.java:1192)
E/MapView (  193):  at android.view.ViewGroup.drawChild
(ViewGroup.java:1418)
E/MapView (  193):  at android.view.ViewGroup.dispatchDraw
(ViewGroup.java:1192)
E/MapView (  193):  at android.view.ViewGroup.drawChild
(ViewGroup.java:1418)
E/MapView (  193):  at android.view.ViewGroup.dispatchDraw
(ViewGroup.java:1192)
E/MapView (  193):  at android.view.View.draw(View.java:5329)
E/MapView (  193):  at android.widget.FrameLayout.draw
(FrameLayout.java:324)
E/MapView (  193):  at com.android.internal.policy.impl.PhoneWindow
$DecorView.draw(PhoneWindow.java:1701)
E/MapView (  193):  at android.view.ViewRoot.draw(ViewRoot.java:
980)
E/MapView (  193):  at android.view.ViewRoot.performTraversals
(ViewRoot.java:829)
E/MapView (  193):  at android.view.ViewRoot.handleMessage
(ViewRoot.java:1103)
E/MapView (  193):  at android.os.Handler.dispatchMessage
(Handler.java:88)
E/MapView (  193):  at android.os.Looper.loop(Looper.java:123)
E/MapView (  193):  at android.app.ActivityThread.main
(ActivityThread.java:3742)
E/MapView (  193):  at java.lang.reflect.Method.invokeNative
(Native Method)
E/MapView (  193):  at java.lang.reflect.Method.invoke(Method.java:
515)
E/MapView (  193):  at com.android.internal.os.ZygoteInit
$MethodAndArgsCaller.run(ZygoteInit.java:739)
E/MapView (  193):  at com.android.internal.os.ZygoteInit.main
(ZygoteInit.java:497)
E/MapView (  193):  at dalvik.system.NativeStart.main(Native
Method)

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] CheckedTextView default setting does not work?

2008-10-14 Thread elephantbug

Hi, Group,

I am using CheckedTextView to keep track the list of settings. But I
failed to find a way to save the previous settings.

No matter how I toggle or setChecked(true) for the CheckedTextView,
the view is always displayed as unchecked the very first time.

I also tried to toggle or setChecked when I bind the adapter with the
listView.  Everything is in vain for now.

Anyone can share some clue?

--elephantbug


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] How to launch SMS message edit from API

2008-09-30 Thread elephantbug

Hi, Group,

Is there a way to launch SMS editor from application?

I know for dialer, we can use following action:
Intent dialIntent = new Intent(Intent.ACTION_DIAL, 
Uri.parse(tel:
+ mPhoneNumber));
startActivity(dialIntent);


Anyone can help?

--elephantbug
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Junit BasicHttpParam Exception

2008-09-29 Thread elephantbug

Hi,

After I migrate my code to 1.0, all my JUnit test cases throw
following exception, anyone can give me some clue:

java.lang.RuntimeException: Stub!
at
org.apache.http.params.AbstractHttpParams.init(AbstractHttpParams.java:
5)
at org.apache.http.params.BasicHttpParams.init(BasicHttpParams.java:
6)
at
com.loopt.network.HttpClientNetworkProvider.init(HttpClientNetworkProvider.java:
39)
at com.loopt.network.NetworkProvider.getInstance(NetworkProvider.java:
65)
at com.loopt.tests.network.BaseTestCase.setUp(BaseTestCase.java:43)
at junit.framework.TestCase.runBare(TestCase.java:132)
at junit.framework.TestResult$1.protect(TestResult.java:110)
at junit.framework.TestResult.runProtected(TestResult.java:128)
at junit.framework.TestResult.run(TestResult.java:113)
at junit.framework.TestCase.run(TestCase.java:124)
at junit.framework.TestSuite.runTest(TestSuite.java:232)
at junit.framework.TestSuite.run(TestSuite.java:227)
at
org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:
130)
at
org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:
38)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:
460)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:
673)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:
386)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:
196)



Here is the code snippet for the HttpClientNetworkProvider:

HttpParams params = new
BasicHttpParams();//line 39:
ConnManagerParams.setMaxTotalConnections(params, 100);
HttpConnectionParams.setConnectionTimeout(params, 20 * 1000);
HttpProtocolParams.setVersion(params, HttpVersion.HTTP_1_1);

// Create and initialize scheme registry
SchemeRegistry schemeRegistry = new SchemeRegistry();
schemeRegistry.register(new Scheme(http,
PlainSocketFactory.getSocketFactory(), 80));
schemeRegistry.register(new Scheme(https,
SSLSocketFactory.getSocketFactory(), 443));

// Create an HttpClient with the ThreadSafeClientConnManager.
// This connection manager must be used if more than one thread 
will
// be using the HttpClient.
ClientConnectionManager cm = new 
ThreadSafeClientConnManager(params,
schemeRegistry);

httpClient = new DefaultHttpClient(cm, params);

Thanks.

--elephantbug



--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: ItemizedOverlay with dynamic items exception problem

2008-09-25 Thread elephantbug

Hi, Peter,

Actually, if you look my code, I have a global array of overlay item.
And I override following code:

public int size()
{
return mFriendList.size();
}

public LptOverlayItem createItem(int i)
{
return mFriendList.get(i);
}

--elephantbug

On Sep 24, 10:56 pm, Peter Stevenson [EMAIL PROTECTED] wrote:
 Hi

 this can be trigger by not create OverlayItem

 //customizedItemizedOverlay
 protected class FriendOverLay extendsItemizedOverlayOverlayItem

 private ListOverlayItem mItemList = new ArrayListOverlayItem();

 {
 public FriendOverLay(Drawable marker) {
 super(marker);

 *mItemList.add(new OverlayItem(whatAroundMe.currentPoint , Title,
 Snippet));*

 populateFriends();

 }

 public synchronized void populateFriends()
 {
 mFriendList = DataManager.getInstance().getFriendLocations();
 super.populate();

 }

 @Override
 public void draw(Canvas canvas, MapView view, boolean shadow ) {

 super.draw(canvas, view, shadow);
 boundCenterBottom(marker);

 //draw other stuffs...

 }
 }
 }

 [EMAIL PROTECTED]
     protected OverlayItem createItem(int i) {

         return mItemList.get(i);
     }

     @Override
     public int size() {

         return mItemList.size();
     }*

 hope it helps
 Peter

 elephantbug wrote:
  Hi, Mark,

  Here is the code snip:
  --
  Main Map Screen
  ---
  public class MyMapActivity extends MapActivity implements Observer{

     //global array of overlay items
     ListOverlayItem mFriendList = Collections.synchronizedList(new
  ArrayListOverlayItem());

          public void onCreate(){
           //init...(omit)
           ...
           //add itemized overlay
            myOverLay = new FriendOverLay(marker);
       mMapView.getOverlays().add(myOverLay);

            //...}

            //observer
     public void update(Observable o, Object args) {
             if(args instanceof Byte)
             {
                     Byte event = (Byte)args;
                     if(event == EVENT_UPDATES)
                     {
                                  // try to refresh the screen
                                  runOnUiThread( new Runnable()
                                  {
                                     public void run()
                                     {
                                             if(myOverLay != null)
                                             {
                                                     
  myOverLay.populateFriends();
                                             }
                                             if(mMapView != null)
                                                     
  mMapView.postInvalidateDelayed(5000);
                                             }

                                  });

                     }
             }
     }

     //customizedItemizedOverlay
     protected class FriendOverLay extendsItemizedOverlayOverlayItem
     {
             public FriendOverLay(Drawable marker) {
                     super(marker);

                     populateFriends();
             }

             public synchronized void populateFriends()
             {
                     mFriendList = 
  DataManager.getInstance().getFriendLocations();
                     super.populate();
             }

            [EMAIL PROTECTED]
             public void draw(Canvas canvas, MapView view, boolean shadow ) {

                     super.draw(canvas, view, shadow);
                     boundCenterBottom(marker);

                     //draw other stuffs...
             }
     }
  }

  -
  The data manager
  -
  public class DataManager extends Observable{

     private ListOverlayItem friendStatus =
  Collections.synchronizedList(new ArrayListOverlayItem());

     public ListOverlayItem getFriendLocations()
     {
             synchronized (friendAccessMutex) {
                     return friendStatus;
             }
     }

          //will spawn a new thread to update the friendStaus array
  periodically.and call setChange and notify the Map Screen (trigger
  update())...

  }

  ---

  Most of time, it works fine. But sometimes ( I have not found the
  pattern yet), it will trigger ArrayOutOfIndexException
  on theItemizedOverlay.draw() method.

  So basically, my question is how to achieve one screen display the
  dynamic data onItemizedOverlay?

  Any input is appreciated.

  Thanks.

  --elephantbug

  On Sep 24, 6:34 pm, Mark Murphy [EMAIL PROTECTED] wrote:

  elephantbug wrote:

  I extend the MapActivity and have anItemizedOverlaywhich will
  display array of items(For example, people) on top of MapView.  These
  items' location are moving and some new items

[android-developers] View after ListView does not show up

2008-09-22 Thread elephantbug

Hi,

I have a problem to display the view (e.g. Button after the ListView
which I will bind and populate from a CursorAdapter).

Here is the part of the XML file:

!-- friend list populated from cursor --
LinearLayout
android:id=@+id/other_contact_layout
android:layout_width=fill_parent
android:layout_height=wrap_content
android:orientation=vertical 

ListView android:id=@android:id/list
android:focusable=true
android:choiceMode=multipleChoice
android:layout_width=fill_parent
android:clickable=true
android:layout_height=wrap_content/
TextView android:id=@android:id/empty
android:layout_width=wrap_content
android:layout_height=wrap_content
android:text=@string/empty/

/LinearLayout
/LinearLayout

LinearLayout
android:id=@+id/add_friend_layout
android:layout_width=fill_parent
android:layout_height=50px
android:layout_marginTop=1px
android:orientation=vertical 

Button
android:id=@+id/add_friend_button
android:layout_width=fill_parent
android:layout_height=wrap_content
android:gravity=center
android:text=bottom here /
/LinearLayout

The list displays perfectly, however, the button at bottom never shows
up.. If I put the button on top of the list, it works fine.

Anyone know the reason?

--elephantbug

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: listActivity and checkBox

2008-09-19 Thread elephantbug

Hi, Mark,

I will go and extend the Adapter for full flexibility. Thanks for your
recommendation.

--elephantbug

On Sep 18, 5:41 am, Mark Murphy [EMAIL PROTECTED] wrote:
 elephantbug wrote:
  It works fine. Now my question is how to differentiate those populated
  TextView? Do they have different IDs?

 As you have it implemented, not really. Technically, they might, but I
 don't think you have any way to get at them by ID.

 Why do you need to differentiate between those populated TextViews?

  If the list item is a complex view withcheckBoxor radio button, how
  can we check their status/state respectively?

 My recommendation, for this scenario, is to create your own adapter
 subclass and override getView(), so you can hook up appropriate
 listeners and whatnot to your list rows.

 I have a seven-post series on AndroidGuys covering this topic and
 related issues. (BLATANT COMMERCIAL PLUG FOLLOWS) These are also rolled
 up into a chapter in my book.

 The most recent post in the series is up to date for the 0.9 SDK:

 http://androidguys.com/?p=659

 However, it probably assumes you've read the first six. Scan through the
 category:

 http://androidguys.com/?cat=7

 and look for the Fancy ListViews posts.

 Also, as the most recent post hints, the Android 1.0 SDK should have a
 fully-functioning checklist implementation -- the guts are there in 0.9,
 but there are bugs preventing it from working properly. Sometime after
 1.0 ships, I'll write up more on the checklist.

 --
 Mark Murphy (a Commons Guy)http://commonsware.com
 Warescription: All titles, revisions,  ebook formats, just $35/year

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: How to launch the street view from map view

2008-09-19 Thread elephantbug

Anyone?

On Sep 9, 2:42 pm, elephantbug [EMAIL PROTECTED] wrote:
 Thanks Megha.

 I think my first question is:

 In the map application on Android, I can not only see thestreetview
 (blue outline on the map) but also I can click one location and launch
 thestreetview(like in Google Map).

 I am developing an Android application, I am wondering whether the SDK
 has some way to do the same thing. The setStreetView(true) in MapView
 will only display the blue outline. I am not sure how to launch thestreetview.

 By the way, thanks for the answer for second question too.

 On Sep 5, 1:45 pm, Megha Joshi [EMAIL PROTECTED] wrote:

  2008/9/4 elephantbug [EMAIL PROTECTED]

   New to android, please forgive if this question sounds naive.

   The latest MapView can check whether the map is instreetviewmode
   and allow users to toggle it.

   However, the setstreetviewapi only display the blue layout on top
   of the map. Is there any way that I can launch thestreetviewlike in
   Google Map.

  I am not sure I understand it correctly, but if  you talking about the maps
  app on android...you  should zoom in more to see the streets.

   Also, does this version support route and direction?

  In the maps app you can look up directions, but there is no directions API
  in the SDK.

   Please kindly advice. Thanks

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] listActivity and checkBox

2008-09-18 Thread elephantbug

Hi,

Android supports to bind and populate data to a list view in
listActivity through some adapters.

You can define the list view in a xml file. Take notePad as example:

//---
// noteslist_item.xml
-
TextView xmlns:android=http://schemas.android.com/apk/res/android;
android:id=@android:id/text1
android:layout_width=fill_parent
android:layout_height=?android:attr/listPreferredItemHeight
android:textAppearance=?android:attr/textAppearanceLarge
android:gravity=center_vertical
android:paddingLeft=5dip
android:singleLine=true
/


Then you can bind the data in the java code by an adapter: for example



Cursor cursor = managedQuery(getIntent().getData(),
PROJECTION, null, null,
Notes.DEFAULT_SORT_ORDER);

// Used to map notes entries from the database to views
SimpleCursorAdapter adapter = new SimpleCursorAdapter(this,
R.layout.noteslist_item, cursor,
new String[] { Notes.TITLE }, new int[]
{ android.R.id.text1 });
setListAdapter(adapter);
-

It works fine. Now my question is how to differentiate those populated
TextView? Do they have different IDs?

If the list item is a complex view with checkBox or radio button, how
can we check their status/state respectively?

Thanks.

--elephantbug

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: WebView display nothing with TabHost

2008-09-13 Thread elephantbug

Hi, Megha,

It works!!!...

Thanks so much.

--elephantbug

On Sep 12, 3:07 pm, Megha Joshi [EMAIL PROTECTED] wrote:
 It seems like you won't get the proper hook into the WebView for changing
 its contents on load, if you load tab's content by id.
 I was able to make this work using TabContentFactory. For sample code see
 the ApiDemos/Views/Tabs sample.
 On subsequent tab clicks you could change the content dynamically using
 OnTabChangeListener.

 2008/9/12 elephantbug [EMAIL PROTECTED]



  Hi,

  The LoadAllLegalText is not a blocking call or different thread.  The
  TOC has been initialized when it is loaded.

  I tried following code even:
                  legalText = (WebView)findViewById(R.id.legal_view);
                  legalText.loadData(htmlbodyboo/body/html,
  mimeType,
  encoding);

  Still nothing displayed..

  On Sep 11, 8:56 pm, Megha Joshi [EMAIL PROTECTED] wrote:
   2008/9/11 elephantbug [EMAIL PROTECTED]

Hi,

The WebView shows nothing the very first time, however, if you switch
to other TAB and return back, everything is displayed.

Here is my XML file:
++
?xml version=1.0 encoding=utf-8?

LinearLayout xmlns:android=http://schemas.android.com/apk/res/
android
   android:layout_width=fill_parent
   android:layout_height=fill_parent
   android:orientation=vertical
   android:gravity=center

   TabHost
               android:id=@android:id/tabhost
               android:layout_width=fill_parent
               android:layout_height=wrap_content

       TabWidget
           android:id=@android:id/tabs
               android:layout_width=wrap_content
               android:layout_height=wrap_content/

       FrameLayout
               android:id=@android:id/tabcontent
               android:layout_width=fill_parent
               android:layout_height=450px
               android:paddingTop=60px

               LinearLayout
               android:id=@+id/legal_layout
               android:orientation=vertical
               android:layout_width=fill_parent
               android:layout_height=400px

               ScrollView
                       android:id=@+id/scroll
                       android:layout_width=fill_parent
                       android:layout_height=350px
                       android:background=@drawable/silver

                       WebView
                               android:id=@+id/legal_view
                           android:layout_width=fill_parent
                           android:layout_height=350px
                           android:minHeight=350dp
                           android:textColor=@drawable/dark
                           android:padding = 3dip
                           android:paddingLeft = 3dip
                           android:paddingRight = 3dip
                           android:paddingTop = 3dip
                           android:paddingBottom = 3dip
                           android:text=test/
               /ScrollView

                   LinearLayout
                       android:orientation=horizontal
                       android:layout_width=fill_parent
                       android:layout_height=wrap_content
                   android:paddingTop = 3dip
                       android:gravity=center

                       Button
                               android:id = @+id/button_accept
                           android:layout_width=wrap_content
                           android:layout_height=wrap_content
                           android:text=@string/button_accept_text/

                       Button
                               android:id = @+id/button_cancel
                           android:layout_width=wrap_content
                           android:layout_height=wrap_content
                           android:text=@string/button_cancel_text/

                       /LinearLayout

       /LinearLayout
               /FrameLayout
       /TabHost

       /LinearLayout


here is part of my code for onCreate:

               //load gloabl asset
               loadAllLegalText();

   If loadAllLegalText() is something that puts data into TOC below, is it a
   blocking call?  You may want to check if TOC actually contains data when
  you
   call loadData()..

               //init the view
               setContentView(R.layout.legal);

               tabHost = (TabHost) findViewById(android.R.id.tabhost);
               tabHost.setup();

               legalText = (WebView)findViewById(R.id.legal_view);
               legalText.getSettings().setJavaScriptEnabled(true

[android-developers] How to exit the application completely from any screen

2008-09-13 Thread elephantbug

Hi,

Is there a way to exit the application completely at any place?

call finish() will only exit the current activity.

I tried to getApplication() from activity and call its onTerminate()
directly... but it seems not working at all...

Anyone can give any clue how to do it?

Thanks


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: How to exit the application completely from any screen

2008-09-13 Thread elephantbug

but our app wants to prevent user from continuing use the app. Maybe
freeze the app can also do the trick, which forces user to use home
dutton. There should be a way to auto exit , just do not know how.
Anyone?

On Sep 13, 12:58 am, Romain Guy [EMAIL PROTECTED] wrote:
 There is no need to do this. The user can just press the Home key to
 exit the app.



 On Fri, Sep 12, 2008 at 6:27 PM, elephantbug [EMAIL PROTECTED] wrote:

  Hi,

  Is there a way to exit the application completely at any place?

  call finish() will only exit the current activity.

  I tried to getApplication() from activity and call its onTerminate()
  directly... but it seems not working at all...

  Anyone can give any clue how to do it?

  Thanks

 --
 Romain Guywww.curious-creature.org

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: WebView display nothing with TabHost

2008-09-12 Thread elephantbug

Hi,

The LoadAllLegalText is not a blocking call or different thread.  The
TOC has been initialized when it is loaded.

I tried following code even:
legalText = (WebView)findViewById(R.id.legal_view);
legalText.loadData(htmlbodyboo/body/html, mimeType,
encoding);

Still nothing displayed..


On Sep 11, 8:56 pm, Megha Joshi [EMAIL PROTECTED] wrote:
 2008/9/11 elephantbug [EMAIL PROTECTED]





  Hi,

  The WebView shows nothing the very first time, however, if you switch
  to other TAB and return back, everything is displayed.

  Here is my XML file:
  ++
  ?xml version=1.0 encoding=utf-8?

  LinearLayout xmlns:android=http://schemas.android.com/apk/res/
  android
     android:layout_width=fill_parent
     android:layout_height=fill_parent
     android:orientation=vertical
     android:gravity=center

     TabHost
                 android:id=@android:id/tabhost
                 android:layout_width=fill_parent
                 android:layout_height=wrap_content

         TabWidget
             android:id=@android:id/tabs
                 android:layout_width=wrap_content
                 android:layout_height=wrap_content/

         FrameLayout
                 android:id=@android:id/tabcontent
                 android:layout_width=fill_parent
                 android:layout_height=450px
                 android:paddingTop=60px

                 LinearLayout
                 android:id=@+id/legal_layout
                 android:orientation=vertical
                 android:layout_width=fill_parent
                 android:layout_height=400px

                 ScrollView
                         android:id=@+id/scroll
                         android:layout_width=fill_parent
                         android:layout_height=350px
                         android:background=@drawable/silver

                         WebView
                                 android:id=@+id/legal_view
                             android:layout_width=fill_parent
                             android:layout_height=350px
                             android:minHeight=350dp
                             android:textColor=@drawable/dark
                             android:padding = 3dip
                             android:paddingLeft = 3dip
                             android:paddingRight = 3dip
                             android:paddingTop = 3dip
                             android:paddingBottom = 3dip
                             android:text=test/
                 /ScrollView

                     LinearLayout
                         android:orientation=horizontal
                         android:layout_width=fill_parent
                         android:layout_height=wrap_content
                     android:paddingTop = 3dip
                         android:gravity=center

                         Button
                                 android:id = @+id/button_accept
                             android:layout_width=wrap_content
                             android:layout_height=wrap_content
                             android:text=@string/button_accept_text/

                         Button
                                 android:id = @+id/button_cancel
                             android:layout_width=wrap_content
                             android:layout_height=wrap_content
                             android:text=@string/button_cancel_text/

                         /LinearLayout

         /LinearLayout
                 /FrameLayout
         /TabHost

         /LinearLayout

  
  here is part of my code for onCreate:

                 //load gloabl asset
                 loadAllLegalText();

 If loadAllLegalText() is something that puts data into TOC below, is it a
 blocking call?  You may want to check if TOC actually contains data when you
 call loadData()..



                 //init the view
                 setContentView(R.layout.legal);

                 tabHost = (TabHost) findViewById(android.R.id.tabhost);
                 tabHost.setup();

                 legalText = (WebView)findViewById(R.id.legal_view);
                 legalText.getSettings().setJavaScriptEnabled(true);
                 legalText.loadData(TOC, mimeType, encoding);

                 Resources rs = getResources();
                 tabHost.addTab(tabHost.newTabSpec(TAG_LEGAL_TOC)

   .setIndicator(rs.getText(R.string.legal_tab_indicator_toc))
                                 .setContent(R.id.legal_layout));

                 tabHost.addTab(tabHost.newTabSpec(TAG_LEGAL_NOTICE)

   .setIndicator(rs.getText(R.string.legal_tab_indicator_legal))
                                 .setContent(R.id.legal_layout));

                 tabHost.addTab(tabHost.newTabSpec(TAG_LEGAL_PRIVACY)

   .setIndicator(rs.getText(R.string.legal_tab_indicator_privacy))
                                 .setContent(R.id.legal_layout

[android-developers] WebView display nothing with TabHost

2008-09-11 Thread elephantbug

Hi,

The WebView shows nothing the very first time, however, if you switch
to other TAB and return back, everything is displayed.

Here is my XML file:
++
?xml version=1.0 encoding=utf-8?

LinearLayout xmlns:android=http://schemas.android.com/apk/res/
android
android:layout_width=fill_parent
android:layout_height=fill_parent
android:orientation=vertical
android:gravity=center

TabHost
android:id=@android:id/tabhost
android:layout_width=fill_parent
android:layout_height=wrap_content

TabWidget
android:id=@android:id/tabs
android:layout_width=wrap_content
android:layout_height=wrap_content/

FrameLayout
android:id=@android:id/tabcontent
android:layout_width=fill_parent
android:layout_height=450px
android:paddingTop=60px

LinearLayout
android:id=@+id/legal_layout
android:orientation=vertical
android:layout_width=fill_parent
android:layout_height=400px

ScrollView
android:id=@+id/scroll
android:layout_width=fill_parent
android:layout_height=350px
android:background=@drawable/silver

WebView
android:id=@+id/legal_view
android:layout_width=fill_parent
android:layout_height=350px
android:minHeight=350dp
android:textColor=@drawable/dark
android:padding = 3dip
android:paddingLeft = 3dip
android:paddingRight = 3dip
android:paddingTop = 3dip
android:paddingBottom = 3dip
android:text=test/
/ScrollView

LinearLayout
android:orientation=horizontal
android:layout_width=fill_parent
android:layout_height=wrap_content
android:paddingTop = 3dip
android:gravity=center

Button
android:id = @+id/button_accept
android:layout_width=wrap_content
android:layout_height=wrap_content
android:text=@string/button_accept_text/

Button
android:id = @+id/button_cancel
android:layout_width=wrap_content
android:layout_height=wrap_content
android:text=@string/button_cancel_text/

/LinearLayout

/LinearLayout
/FrameLayout
/TabHost

/LinearLayout



here is part of my code for onCreate:

//load gloabl asset
loadAllLegalText();

//init the view
setContentView(R.layout.legal);

tabHost = (TabHost) findViewById(android.R.id.tabhost);
tabHost.setup();

legalText = (WebView)findViewById(R.id.legal_view);
legalText.getSettings().setJavaScriptEnabled(true);
legalText.loadData(TOC, mimeType, encoding);

Resources rs = getResources();
tabHost.addTab(tabHost.newTabSpec(TAG_LEGAL_TOC)

.setIndicator(rs.getText(R.string.legal_tab_indicator_toc))
.setContent(R.id.legal_layout));

tabHost.addTab(tabHost.newTabSpec(TAG_LEGAL_NOTICE)

.setIndicator(rs.getText(R.string.legal_tab_indicator_legal))
.setContent(R.id.legal_layout));

tabHost.addTab(tabHost.newTabSpec(TAG_LEGAL_PRIVACY)

.setIndicator(rs.getText(R.string.legal_tab_indicator_privacy))
.setContent(R.id.legal_layout));

..
//set focus
tabHost.setOnTabChangedListener(this);
tabHost.setCurrentTabByTag(TAG_LEGAL_TOC);


+++

There is one thread about WebView display nothing and I tried their
suggestion, none works...

Anyone has any clue? or it is Android's bug.

http://code.google.com/p/android/issues/detail?id=678
http://www.mail-archive.com/android-developers@googlegroups.com/msg02420.html

--elephantbug

--~--~-~--~~~---~--~~
You received

[android-developers] Re: WebView display nothing with TabHost

2008-09-11 Thread elephantbug

Mark,

I tried that. The problem still persists...

I even tried to some simple Html in onCreate method... nothing
displayed at all..

On Sep 11, 4:18 pm, Mark Murphy [EMAIL PROTECTED] wrote:
 elephantbug wrote:
  The WebView shows nothing the very first time, however, if you switch
  to other TAB and return back, everything is displayed.

 Don't put WebView in a ScrollView. It does its own scrolling.

 I don't know if that is your problem, but it is worth a try.

 --
 Mark Murphy (a Commons Guy)http://commonsware.com
 Warescription: All titles, revisions,  ebook formats, just $35/year

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: How to launch the street view from map view

2008-09-09 Thread elephantbug

Thanks Megha.

I think my first question is:

In the map application on Android, I can not only see the street view
(blue outline on the map) but also I can click one location and launch
the street view (like in Google Map).

I am developing an Android application, I am wondering whether the SDK
has some way to do the same thing. The setStreetView(true) in MapView
will only display the blue outline. I am not sure how to launch the
street view.

By the way, thanks for the answer for second question too.


On Sep 5, 1:45 pm, Megha Joshi [EMAIL PROTECTED] wrote:
 2008/9/4 elephantbug [EMAIL PROTECTED]



  New to android, please forgive if this question sounds naive.

  The latest MapView can check whether the map is in street view mode
  and allow users to toggle it.

  However, the set street view api only display the blue layout on top
  of the map. Is there any way that I can launch the street view like in
  Google Map.

 I am not sure I understand it correctly, but if  you talking about the maps
 app on android...you  should zoom in more to see the streets.



  Also, does this version support route and direction?

 In the maps app you can look up directions, but there is no directions API
 in the SDK.



  Please kindly advice. Thanks

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] How to launch the street view from map view

2008-09-05 Thread elephantbug

New to android, please forgive if this question sounds naive.

The latest MapView can check whether the map is in street view mode
and allow users to toggle it.

However, the set street view api only display the blue layout on top
of the map. Is there any way that I can launch the street view like in
Google Map.

Also, does this version support route and direction?

Please kindly advice. Thanks

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new Android 0.9 SDK beta!
http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: How to set initial MapActivity zoom level?

2008-09-05 Thread elephantbug

mapView.getMapController().setZoom(int zoomLevel)

zoomLevel is between 1 to 21 inclusive.

You can set the initial zoom level in OnCreate().

Hope it can help.

JM.

On Sep 4, 11:12 pm, Mark Wyszomierski [EMAIL PROTECTED] wrote:
 Hi,

 I've added a MapActivity to my application. How can we set the initial
 zoom level? Right now I'm zoomed out so far I can see North and South
 America simultaneously. I probably need something more like street
 level,

 Thanks,
 Mark

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new Android 0.9 SDK beta!
http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---