Android :: Back To Activity After WebView?

Nov 14, 2009

I've been searching and looking for this answer for quite some time now. I want to display a little HTML in a webView.

When the User read the HTML, he's supposed to use the back button to go back to the previous activity. However, it closes the App.

How can I make it go back to the last Activity? It would also be ok to display a soft back button or something. Here my code...

Android :: Back to Activity after WebView?


Android : WebView - Not Able To Go Back To My Activity Screen Once The Content Is Displayed

Apr 9, 2009

Step 1: I am subclassing WebView and rendering html content properly. The intial content is very small with a div and image /link This is displayed in a LInear Layout along with a TextView and ListView. That is my first screen/activity of the application.

Step 2: When I click on a link on this webview, it goes through the webViewclient and expands to full screen to fit the content of the requested page.

After Step 2, I am not able to go back to my activity screen once the content is displayed. When I click on the back button to getback to my activity screen close my activity and goes to the phone's applications desktop. (i.e goes out of my application).

Step 3: In order to fix this issue, I stopped setting my own subclasssed WebViewClient. After doing this, the it seems to render the clicked page in a webView as subactivity. Now When I click on backbutton, it goes back to the activity screen. But, the issue now is, I am not catch event when a link is clicked. How can I catch click events in this case.

View 2 Replies View Related

Android :: WebView.clearHistory() - Don't Want Back Button To Allow User To Go Back Further Than Current Session

Mar 31, 2009

I call WebView.clearHistory(), but I am still able to go back after doing so. I want to reuse a WebView, but I don't want the back button to allow the user to go back further than the current "session" of using the WebView. Anybody know what is the best way to handle this? I thought for sure that clearHistory() would do it.

View 3 Replies View Related

Android :: Start An Activity And Return Back To Original Activity

Jan 26, 2009

I have an application with contains multiple activities. The main activity will start the others ( use startActivity() ) depends on user event, when an activity close, it calls finish() and return back to main activity. It appears to behavior like that.

However, the "problem" I see is main activity's onCreate function is called every time. I think the the main activity should be placed in the activity stack and simply push to front when others exit, therefore only onResume, onStart are called. Is there some flag I need to set or I misunderstand the activity behaviro?

In child activity, besides calling finish() or startActivity for main activity, what is other way to move main activity to front?

View 2 Replies View Related

Android :: How To Clear Activity From Second Activity Going Back To Home Screen?

Mar 3, 2010

example scenario is: from login screen - main screen - then when i clicked a hide button the app will go to home screen, and when im going to click the app again the main screen would be called.

View 2 Replies View Related

Android :: Fom Webview To Activity

Feb 23, 2010

is it possible that a user clicks inside a webview on a link like <a href/> and then my activity is opened? I need this for sms, email, telephone and some specials. Lets say the user browses on the impressum and clicks on the phone number for support. I want the phone to call that number.Or lets say the browser clicks on an image (with a special href?), and I want the user to land on my picture-view-activity.

View 3 Replies View Related

Android :: Keep Webview In One Activity?

Jan 10, 2010

Does some please let me know how to use webview? I want to make a webview keep to work wthin in a layout without opening new web browser when clicking a link tag.

For instance, you can see the "Hello" text and google web page on a display. Then if you click the "help" or "news" or "settings" links, the android boots new web window and shows the web page.

I want to keep/fix the webview to open web page. I dont want to start android embedded web browser.

CODE:....................

View 3 Replies View Related

Android :: From WebView In Droid Back To A ListView?

Jul 29, 2010

After a successful web view is loaded, now after some processing on the HTML page, I would like to return the control to the main screen. Is this possible in Android?

The control after the webview is launched, is in the browser, so after I make some ajax calls and then get a positive server side message. I would like the control goback to my Webview Activity.

View 2 Replies View Related

Android :: Set Fix Zoom Level / Scale Back In Webview?

Sep 1, 2010

Zoom works without any problem, but if I select any input field the webview zooms in automatically.

How do I can prevent this zoom behavior?

set fix zoom level?
scale back to previous zoom level?

View 1 Replies View Related

Android Webview - After Changing Scale To 1.5 It Reverting Back?

Apr 26, 2014

I wrote a sample application which displays some test message using webview .The Application has two activities, one activity simply contains a button, when user click on this button , it launch another activity which display the test message on a webview .

I have set setInitialScale() of webview as 150, Now the issue is like, Normally webvbiew displays the content with the scale size 150 (as I set ) but some times it displays the contents with a scale greater than 150.

I overrided the onScaleChanged() function in webViewClient.

In normal case before drawing the content on webview I am getting onScaleChanged() callback ,with the value oldscale as 2 and new scale as 1.5. When issue occurs , I am getting two onScaleChanged() callbacks before drawing the content!!! ,at first I get the onScalechange() callback with oldscale as 2 and new scale as 1.5 , after that getting another onScaleChanged() callback with oldscale as 1.5 and new scale as 2.0 and hence it draws the webview with the scale 2.0 irrespective of setInitialScale() I have given in my application.

This issue happens only in the case if I set setInitialScale() to a value less than device's default webview scale. As per my understanding ,Every device has its own default Scale for webview based on their display property like .075 for ldpi and 1.5 for hdpi etc )

In my device defaultScale for webview is 2, and I set the setInitialScale() as 1.5(150)

normaly webview reset the scale from 2 to 1.5 before draw ( That is from defult to new value ) and it works fine
But some time after changing the scale to 1.5 it reverting back to 2. and issue occurs

public class webActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
[Code].....

View 1 Replies View Related

Android :: Scrolling My Activity Including WebView

Nov 12, 2010

I included a WebView in my activity and load some Javascript in it which is then going to get data from an external website.This works and displays fine but the problem is that my activity doesn't scroll when the WebView is done loading so I can't see the bottom of the WebView such as all the other Views I put below this.

View 2 Replies View Related

Android :: Can I Disable Webview On Click Activity

Jul 14, 2010

can i disable the webview onClick Activity(); I have a couple of webviews in a listactivity and i want to capture the listclick instead.

View 3 Replies View Related

Android :: How To Do A WebView / ListView In Same Activity OnCreate?

Feb 10, 2010

As you can see, I first create a webview. Then, I want it to immediately disappear. Then, I want the Listview to come up. But the problem is, I can't do Listview if I don't do ListActivity but then I can't do Activity. Code...

View 2 Replies View Related

Android :: Activity Timeout On WebView Load

Aug 3, 2009

In my app I have to load external page into WebView-based activity. Some of my users with slower connections are reporting screen timeout while waiting for the page to load. What would be a good way of loading the page on backgorund thread and then refreshing the screen? Use HttpClient to fetch it and then use WebView#loadData? My fear is - the page I'm loading is pretty complicated there's some JS that happens on load - wouldn't I just mess it up? Is there an alternative way of doing what I need?

View 5 Replies View Related

Android :: Pass A Username And Password Back Into A Webview Securely?

Jul 1, 2010

I have a user's name and password stored in their preferences.

How do I go about passing it back into the webview in a secure way?
I know if I do this it will work, but it just seems bad. There has to be a better way to post the variables.

webview.loadUrl("http://mysite.com?name="+username+"&password="+somepassword);

I've been looking for days and can't find anything, which make me think I'm missing something obvious.

View 3 Replies View Related

Android : Webview - OnCreate Always Get Called When Activity Comes To Foreground

Mar 29, 2009

I launch my TestWebView activity. After my web page is loaded, I put the app in the background by pressing the Home key. Then I bring the TestWebActivity back to the foreground. Unexpectedly, TestWebView's onCreate() is called when I bring the activity to the foreground. But onDestroy is never called. This same thing happens every time I tested. It appears the old TestWebView was not completely killed so there are possibly duplicate web clients running.

My code: .....

View 7 Replies View Related

Android :: Pause Flash Content In WebView When Activity Isn't Visible?

Aug 7, 2010

I am experimenting with using a WebView to display Flash content inside my activity. Everything is working pretty well, but when the user hits the home key to put the activity into the background, the Flash content keeps running (sound keeps playing, etc)

I have noticed that both the stock Android browser and Dolphin Browser seem to avoid this problem, and properly pause the Flash content when the browsing activity is put into the background.

Ideally I would like a solution that kills the WebView completely if the activity is finishing, but pauses it otherwise (basically copying the default behavior of the browser)

Here is a simple test I put together that loads a game on Kongregate which has some background music:

CODE:..............

I took a look at the latest source for the stock browser, and it seems to be doing something similar (calling pauseTimers/resumeTimers), although I fear the code I have been looking at is out of date, because it is calling functions that don't seem to exist anymore.

I did verify that the call to pauseTimers is working by testing with a simple JavaScript setInterval which updates a counter. Is there something else obvious that I should be trying in regard to Window or View management?

The documentation for the mobile Flash player says:


Flash Player will also automatically pause SWF playback it is not in view or the foreground application, for example when a call is received or alarm goes off, to reduce CPU utilization, battery usage and memory usage.


This seems to be working perfectly in both the stock browser and Dolphin Browser, but not in my app. Any ideas/solutions would be greatly appreciated!

Update: Here is the function we ended up adding to our activity to get this to work. We call it with "onPause" in the activity's onPause function and "onResume" in the activity's onResume function:

CODE:....................

View 2 Replies View Related

Android :: Retrieve User-Agent Programatically Without Having A WebView In Activity?

Sep 2, 2010

Is there a way to retrieve Browser's user-agent without having a WebView in activity?

I know it is possible to get it via WebView:

WebView view = (WebView) findViewById(R.id.someview);
String ua = view.getSettings().getUserAgentString() ;

But in my case I don't have/need a webview object and I don't want to create it just for retrieving user-agent string.

View 1 Replies View Related

Android :: How To Show A Webview Inside An Activity In Middle Of Screen

Jul 30, 2010

I am having issue while showing a WebView in an activity in the middle of the screen. I have an activity and I want to show a webview in the center of screen. My activity is transparent so background activity will be visible. Whenever I try to create a webview and add it to activity using setContentView(webview) it always shows the view on the top left corner of the screen. Is their a way to workaround this?I am trying to do this via pure code only.

Here is my code.

CODE:....................

View 1 Replies View Related

Android :: Cant Go Back To Previous Page From Webview Page

Feb 2, 2009

I am developing simple RSS Reader kind of application.In my applicaion i cant go back from Webview page to previous page.i can go back from all pages except the page where i have used Webview.What could be the reason?why i cant go back?

View 3 Replies View Related

Android :: Back To Activity When Call Is Done

Nov 24, 2010

I am launching an activity to make a phone call, but when I pressed the 'End Call' button, it does not go back to my activity. Can you please tell me how can I launch a call activity which comes back to me when 'End Call' button is pressed?

View 5 Replies View Related

Android :: Back Button Activity

Aug 25, 2010

I was wondering how or if it is possible to exclude activities from the back buttons history list? For example not letting the user back into the Splash Screen?

View 2 Replies View Related

Android : Activity And Back Button

Nov 2, 2010

on the ui i am having a back button displayed. there are three activities say A,B,C. Activity A is splash screen. Activity B is home screen. Activity C is edit screen. on edit screen only i am having a back button. when the user press that i open the activity B which also contains some sort of http request and response. i want that the previous activity from stack should get displayed? how can i achieve that? i am able to open previous activity on pressing the back button of device? when i press back button on device there doesnt goes any http request? i want to achieve this behaviour when i press the ui back button.

View 2 Replies View Related

Android : Back Button And Last Activity

Aug 17, 2010

My app chains some activities.

if you press the back button, you go back through old activities then you suddenly quit the application !

so I need to show a message like "do you really want to exit" if it's the last activity on stack

I know how to override the back button but i can't figure how to know how many activity are in history

CODE:..................

View 1 Replies View Related

Android : Back Key Destroy An Activity

Jul 14, 2010

I have an activity defined as below:

CODE:............

A strange thing is that, when running on emulator, and the back key is pressed, the activity was destroyed (I saw onDestroy() called in log). But when running on my Nexus One phone, and the back key is pressed, the activity is not destroyed (I didn't see onDestroy() called in log).

View 1 Replies View Related

Android : Need To Get Result Back From Activity?

Mar 10, 2010

I'm doing some network job in AsyncTask. Sometimes it requires communication with user. (connection is dropped, session is expired and so on). I want to pop up a dialog or launch an Activity, and then, depending on user's input, stop the job or redo it. I can launch any Activity from AsyncTask, but how to get result back? It seems to be possible only if I launch new Activity from another Activity. What are possible solutions?

View 5 Replies View Related

Android :: Any Way To Go 2 Steps Back In Activity Stack?

Apr 7, 2010

Android - Can I force BACK button to go 2 steps back in the Activity stack with some kind of code? I know I can override the onKeyDown method but I want BACK to do it's thing, just twice!

View 3 Replies View Related

Android :: Hide Activity On BACK Key Without OnDestroy?

Oct 28, 2009

When user presses BACK key, my activity's onDestroy is called and then it is killed. Is there a way (by overridding Activity.onKeyDown??) to simply put the activity into background without killing it? I want the BACK key to act like the HOME key (which doesn't kill my app), except I want to show the activity immediately below my activity.

View 7 Replies View Related

Android :: Start Browser Then Go Back To My Activity

Jan 29, 2009

Our application has a fair amount of java script. As far as we known, WebView widget doesn't handle AJAX, therefore we want to bring up the brower to load the url. The problem is, after user done with browser, how can it goes back to where it left in our application? ( when user quit the browser, our application will show up the activity before went to browser)

View 2 Replies View Related

Android :: How To Come Back Main Activity From Child One?

Mar 30, 2010

I'm in a small problem.i have three activities (suppose A,B,C) after performing onclick event in activity A, i can go to activity B and then C..my question is that is there any way to comeback activity A from C..here is the code snippet public void on Create(Bundle Code...

View 3 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved