Zoom from a point

by araj2...@gmail.com » Fri, 09 Jan 2009 00:01:12 GMT


Sponsored Links
 Hi,
     Can someone tell me how zoom in the Browser application is done
from the center of a page and not from (0, 0)?
Webkit by default does zoom from the origin.
Just curious to know how zoom from center is done in Android's
browser.

Regards,
Amruth Raj.

--~--~---------~--~----~------------~-------~--~----~



Other Threads

1. Android memory problem + Surface holder problem (surfaceview game)

Hi.

there are 2 ways to let user press "home" and return back with their
status correct :

1.

public gameView(Context context, AttributeSet attrs) {
    super(context, attrs);
    SurfaceHolder holder = getHolder();
    holder.addCallback(this);
    thread = new gameThread(holder);
}
public void surfaceCreated(SurfaceHolder holder)
{
    if (!thread.isAlive())
    {
        thread = new gameThread(holder);
    }
    thread.start();
    thread.runThread = true;
}
public void surfaceDestroyed(SurfaceHolder holder)
{
    thread.runThread = false;
    boolean {*filter*} = true;
    while ({*filter*})
    {
        try
        {
            thread.join();
            {*filter*} = false;
        }
        catch (InterruptedException e)
        {
        }
    }
}
this is the lunarlander based + a bit improved version.

2.

public gameView(Context context, AttributeSet attrs)
{
    super(context, attrs);
    SurfaceHolder holder = getHolder();
    holder.addCallback(this);
}
public void surfaceCreated(SurfaceHolder holder)
{
    thread = new gameThread(holder);
    thread.start();
    thread.runThread = true;
}
public void surfaceDestroyed(SurfaceHolder holder)
{
    thread.runThread = false;
    boolean {*filter*} = true;
    while ({*filter*})
    {
        try
        {
            thread.join();
            {*filter*} = false;
        }
        catch (InterruptedException e)
        {
        }
    }
}
EITHER WAY can't let me insert this code in my "thread constructor":

Bitmap land = Bitmap.createBitmap(2000, 2000,
Bitmap.Config.ARGB_8888);
I know it is way too big. But even If I turn it smaller like

mapland = Bitmap.createBitmap(1000, 1000, Bitmap.Config.ARGB_8888);
The activity still crush after 3 times of "home and return".

I have added this line to the modified lunarlander and the famous
"RockScissorsPaper" tutorial to test, they all crashed.

I don't understand this : Didn't I release memory since thread.join()
was called??

I really need this bitmap for my application and I want to access it
in my thread, does anyone have any idea ??

Thanks if there are any clues or suggestions, I would be very glad and
thankful.

Steven

-- 

2. Is your activity running?

Hi,
I am facing a problem.Searching over the forum did not get any
solution.
I have a tab based application where I am using Activity group.
I have 4 tabs
|->Search->Search Result
|->Popular
|->Recent
|->Post

Popular and Recent tabs are being loaded with a progress dialog as
they collecting data from the web/network.

The search tab is sending some data for searching and loading in a
child activity  for search result.

I am using a progress dialog for loading data of the search..
But When I submit the search button in the Search activity I am
getting the error

<b>
10-19 12:35:20.718: WARN/System.err(461): android.view.WindowManager
$BadTokenException: Unable to add window -- token
android.app.localactivitymanager$localactivityrec...@43784740 is not
valid; is your activity running?

</b>

I am attaching the stacks trace


10-19 12:35:20.728: WARN/System.err(461):     at
android.view.ViewRoot.setView(ViewRoot.java:456)
10-19 12:35:20.728: WARN/System.err(461):     at
android.view.WindowManagerImpl.addView(WindowManagerImpl.java:177)
10-19 12:35:20.728: WARN/System.err(461):     at
android.view.WindowManagerImpl.addView(WindowManagerImpl.java:91)
10-19 12:35:20.728: WARN/System.err(461):     at android.view.Window
$LocalWindowManager.addView(Window.java:409)
10-19 12:35:20.728: WARN/System.err(461):     at
android.app.Dialog.show(Dialog.java:238)
10-19 12:35:20.738: WARN/System.err(461):     at
android.app.Activity.showDialog(Activity.java:2413)
10-19 12:35:20.738: WARN/System.err(461):     at
com.tunespray.job.SearchJobList.getJobs(SearchJobList.java:83)
10-19 12:35:20.738: WARN/System.err(461):     at
com.tunespray.job.SearchJobList.onCreate(SearchJobList.java:40)
10-19 12:35:20.738: WARN/System.err(461):     at
android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:
1123)
10-19 12:35:20.738: WARN/System.err(461):     at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:
2364)
10-19 12:35:20.738: WARN/System.err(461):     at
android.app.ActivityThread.startActivityNow(ActivityThread.java:2242)
10-19 12:35:20.738: WARN/System.err(461):     at
android.app.LocalActivityManager.moveToState(LocalActivityManager.java:
127)
10-19 12:35:20.748: WARN/System.err(461):     at
android.app.LocalActivityManager.startActivity(LocalActivityManager.java:
339)
10-19 12:35:20.748: WARN/System.err(461):     at
com.tunespray.job.TabGroupActivity.startChildActivity(TabGroupActivity.java:
61)
10-19 12:35:20.748: WARN/System.err(461):     at
com.tunespray.job.SearchJob.onClick(SearchJob.java:35)
10-19 12:35:20.748: WARN/System.err(461):     at
android.view.View.performClick(View.java:2344)
10-19 12:35:20.748: WARN/System.err(461):     at
android.view.View.onTouchEvent(View.java:4133)
10-19 12:35:20.748: WARN/System.err(461):     at
android.view.View.dispatchTouchEvent(View.java:3672)
10-19 12:35:20.748: WARN/System.err(461):     at
android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:882)
10-19 12:35:20.758: WARN/System.err(461):     at
android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:882)
10-19 12:35:20.758: WARN/System.err(461):     at
android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:882)
10-19 12:35:20.758: WARN/System.err(461):     at
android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:882)
10-19 12:35:20.758: WARN/System.err(461):     at
android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:882)
10-19 12:35:20.758: WARN/System.err(461):     at
com.android.internal.policy.impl.PhoneWindow
$DecorView.superDispatchTouchEvent(PhoneWindow.java:1712)
10-19 12:35:20.758: WARN/System.err(461):     at
com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:
1202)
10-19 12:35:20.758: WARN/System.err(461):     at
android.app.Activity.dispatchTouchEvent(Activity.java:1987)
10-19 12:35:20.768: WARN/System.err(461):     at
com.android.internal.policy.impl.PhoneWindow
$DecorView.dispatchTouchEvent(PhoneWindow.java:1696)
10-19 12:35:20.768: WARN/System.err(461):     at
android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:882)
10-19 12:35:20.768: WARN/System.err(461):     at
android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:882)
10-19 12:35:20.768: WARN/System.err(461):     at
com.android.internal.policy.impl.PhoneWindow
$DecorView.superDispatchTouchEvent(PhoneWindow.java:1712)
10-19 12:35:20.768: WARN/System.err(461):     at
com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:
1202)
10-19 12:35:20.778: WARN/System.err(461):     at
android.app.Activity.dispatchTouchEvent(Activity.java:1987)
10-19 12:35:20.778: WARN/System.err(461):     at
com.android.internal.policy.impl.PhoneWindow
$DecorView.dispatchTouchEvent(PhoneWindow.java:1696)
10-19 12:35:20.778: WARN/System.err(461):     at
android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:882)
10-19 12:35:20.778: WARN/System.err(461):     at
android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:882)
10-19 12:35:20.778: WARN/System.err(461):     at
android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:882)
10-19 12:35:20.788: WARN/System.err(461):     at
android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:882)
10-19 12:35:20.788: WARN/System.err(461):     at
android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:882)
10-19 12:35:20.788: WARN/System.err(461):     at
com.android.internal.policy.impl.PhoneWindow
$DecorView.superDispatchTouchEvent(PhoneWindow.java:1712)
10-19 12:35:20.788: WARN/System.err(461):     at
com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:
1202)
10-19 12:35:20.788: WARN/System.err(461):     at
android.app.Activity.dispatchTouchEvent(Activity.java:1987)
10-19 12:35:20.798: WARN/System.err(461):     at
com.android.internal.policy.impl.PhoneWindow
$DecorView.dispatchTouchEvent(PhoneWindow.java:1696)
10-19 12:35:20.798: WARN/System.err(461):     at
android.view.ViewRoot.handleMessage(ViewRoot.java:1658)
10-19 12:35:20.798: WARN/System.err(461):     at
android.os.Handler.dispatchMessage(Handler.java:99)
10-19 12:35:20.798: WARN/System.err(461):     at
android.os.Looper.loop(Looper.java:123)
10-19 12:35:20.798: WARN/System.err(461):     at
android.app.ActivityThread.main(ActivityThread.java:4203)
10-19 12:35:20.798: WARN/System.err(461):     at
java.lang.reflect.Method.invokeNative(Native Method)
10-19 12:35:20.798: WARN/System.err(461):     at
java.lang.reflect.Method.invoke(Method.java:521)
10-19 12:35:20.798: WARN/System.err(461):     at
com.android.internal.os.ZygoteInit
$MethodAndArgsCaller.run(ZygoteInit.java:791)
10-19 12:35:20.808: WARN/System.err(461):     at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:549)
10-19 12:35:20.808: WARN/System.err(461):     at
dalvik.system.NativeStart.main(Native Method)



Please help me to solve the issue as I am middle of my work..

Thanks in advance
Tanmay

-- 

3. how to extract class information from code

4. orientation problem

5. Android serial port

6. getSharedPreferences and static reference to a Context object

7. Dialog change orientation