[android-developers] Activity behind a floating window does not update but receives touch events

2011-06-23 Thread jgaribay
Hi,

I am launching a floating activity to be displayed on top of the
screen when a call is placed or received and I want this activity do
not interfere with the call, the user should be able to answer a call
and hang up.

With the following code I almost accomplish this, the only problem is
that after I slide the bar to answer a call the button to hang up is
not displayed. I am not sure if it is a limitation because the phone
dialer activity goes to onresume and it wont update the UI?? If this
is true, is there a way work around it??


protected void onCreate(Bundle savedInstanceState){
super.onCreate(savedInstanceState);

final Window window = this.getWindow();
window.setFlags(WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL 
|
WindowManager.LayoutParams.FLAG_WATCH_OUTSIDE_TOUCH,

WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL |

WindowManager.LayoutParams.FLAG_WATCH_OUTSIDE_TOUCH);

WebView webView = new WebView(this);
loadContent(webView);

setContentView(webView);

window.setGravity(Gravity.TOP);
window.setLayout(480,100);

WindowManager.LayoutParams lp = window.getAttributes();
lp.dimAmount= 0.0f;
lp.alpha = 1.0f;
window.setAttributes(lp);
...
}

This activity is displayed for a few seconds and then is closed but I
want it to be as seamless as possible and if the users does not see
the hang up button it is going to be a bit awkward.

I do not want to display the information in this activity in a toast
or a notification. In case the user finds it intrusive I have an
option to disable it (for instance it is disabled by default).

Regards,
Juan

-- 
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] how to intercept javascript onclick="window.close()"

2010-10-03 Thread jgaribay
Hi,

I am displaying web content in a WebView but I am having issues to
identify when the user presses a cancel button which should close the
current window.

The cancel button is defined as follows in the page source code:


There are other buttons which I am able to handle using
shouldOverrideUrlLoading() but since this cancel buttons does not
attempt to open a new page, this is not working.

Does anyone know if there is a way to intercept this cancel???

By the way, when cancel button is pressed nothing happens.

Thanks in advanced,
Juan

-- 
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] Re: how to intercept javascript onclick="window.close()"

2010-10-04 Thread jgaribay
thanks for replay, yes that for sure would work but that is not my
page so I do not have control over the content

On Oct 3, 11:21 pm, metal mikey  wrote:
> You could replace theJavaScript("window.close();") with some 
> otherJavaScriptthat you can intercept.
>
> On Oct 4, 2:31 pm, jgaribay  wrote:
>
> > Hi,
>
> > I am displaying web content in a WebView but I am having issues to
> > identify when the user presses a cancel button which should close the
> > current window.
>
> > The cancel button is defined as follows in the page source code:
> >  > onclick="window.close();" />
>
> > There are other buttons which I am able to handle using
> > shouldOverrideUrlLoading() but since this cancel buttons does not
> > attempt to open a new page, this is not working.
>
> > Does anyone know if there is a way to intercept this cancel???
>
> > By the way, when cancel button is pressed nothing happens.
>
> > Thanks in advanced,
> > Juan
>
>

-- 
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] TextView behavior with the same attributes is different in API 7 and 9 !?

2011-03-14 Thread jgaribay
Hi,

I was debugging an Activity that was working fine (the view is
displayed) using API 7 but  not using API 9.

This is a snippet of code simplified of what I am doing to reproduce
the issue:

public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);

LinearLayout ll = new LinearLayout(this);
LinearLayout.LayoutParams llp = new
LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT,
LinearLayout.LayoutParams.WRAP_CONTENT);
ll.setLayoutParams(llp);

TextView tv = (TextView) new TextView(this);
tv.setLayoutParams(llp);
tv.setFocusable(true);
tv.setFocusableInTouchMode(true);
tv.setText("Test");
tv.setTextAppearance(this,
android.R.style.TextAppearance_Large );

ll.addView(tv);
setContentView(ll);
}

In API 9 this works if:
1)   tv.setFocusable(true) &   tv.setFocusableInTouchMode(true) are
commented out
2)   tv.setTextAppearance(this, android.R.style.TextAppearance_Large )
is commented out

In API 7 all combinations work as expected.

I know attributes can be set in the xml but I want to set them in the
code and understand what is happening here. Does anyone  know why it
is not working in API 9?

Thanks,
Juan Garibay

-- 
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] Re: finishActivity() does not stop child activity

2011-03-26 Thread jgaribay
Hi,

I have a similar issue and I am using the same approach:

Service -> ProxyActivity -> Activity

But the Activity I want to start and finish is an android activity
started with ACTION_CALL from ProxyActivity and it has singleInstance
launch mode in the manifest but it seems I can not change it.
According to the documentation startActivityForResult() should not be
used to launch activities that wont be run in the same task so that
would explain why my finishActivity() is not working.

Is there a workaround or other way to finish activities are not in the
same task?

Thanks
Juan Garibay

On Mar 15, 12:05 pm, Ramsay Domloge  wrote:
> Cracked it.
>
> I removed android:launchMode="singleInstance"  from the Proxy Activity
> declaration in the Manifest and suddenly the Proxy was able to close the 3rd
> Party Activity.
>
> Many thanks for your help guys - your suggestions pointed me in the right
> direction.

-- 
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