I have written an activity that has 2 image buttons (1 for messaging and another for browser). On click on each will start messaging and browser android activities respectively.
My question is: whenever I start my app and click on any of the buttons say browser button for example, and after it starts the android browser app, and it allows me whatever to browse in this time if I press the home button on android emulator and again if I start my app and select the browser button in my activity as usual the browser get started from the beginning rather than starting form where I left previously.
Should I start a service to call browser activity or should I set some flags while calling android browser activity?
You might try setting the FLAG_ACTIVITY_REORDER_TO_FRONT on your browser intent and see if it's the behavior you're looking for. This way if the browser already exists, it will just reorder the browser activity to the front and not launch a new browser.
Related
I have app that after installtion need to be hidden in home menu.
the app is for push notifications only.
I read this but android.intent.action.BOOT_COMPLETED not work.
there I read also Think Twice Code Once answer.
so currently I am searching about way to interact with user at least once after installation without activity or with activity in the way that app icon not appear in home menu. or change reciver or service state immediately after installtion without user interaction
any idea?
thanks!
The app needs to be run manually at least once by the user, otherwise the app will remain in the "stopped state" and you will not receive any broadcast Intents. You will need to have an Activity and that Activity will need to have an entry in the manifest with ACTION=MAIN and CATEGORY=LAUNCHER. What you could do is disable the Activity programmatically after it is launched the first time. This would prevent the Activity from being shown on the HOME screen. Here's an example:
PackageManager pm = getPackageManager();
pm.setComponentEnabledSetting(new ComponentName(this, my.packagename.MainActivity.class),
PackageManager.COMPONENT_ENABLED_STATE_DISABLED, PackageManager.DONT_KILL_APP);
NOTE: If you do this, and the user "force stops" your app (Android settings->Apps->YourApp->Force Stop) then there will be no way to restart your app other than uninstalling and reinstalling it.
For example, maybe the user can choose the app from the ones that are installed on the device or the ones that are currently running in the background. Or maybe inspect the current page of the app running in the background, for example inspect the register page of Facebook app, then login on Facebook and inspect the home page of it.
Something like the Uiautomator but running on android..
Like the question been struggling with this for a day now
I tried out onPause, onStart etc but they all seem to fire regularly.
My setup is this I discovered a bug in my App.
If I start App gets directed to login screen Activity!
I have all the login possible, but if I press the Home button on my Android phone.
The Middle one. App closes down... I then go back to the icon and press it.
The app opens and automatically passed login activity.
So I tried multiple ways with the different events firing to redirect back to the login screen but nothing is working correctly.
For example, if I trigger a start activity call in the restart event.
but then login activity is overriding everything even starts again after pushing loginbutton.
I hope this explains a bit but I am open to trying anything at this point.!
I want to send a string from an android application and dump it in a textbox and then click a button present in the ASP website without opening that website on the phone (the button and the textbox are both present on the asp web page).
I have control over the website (stuff like __VIEWSTATE and the __EVENTVALIDATION strings for the ASP Page are available). I would want to know if there is a way to do this using the __VIEWSTATE and the __EVENTVALIDATION strings. If there is an alternate way, could you please kindly explain me in a step-wise manner.
I supouse that you would like to start some process on web site after click (for example create/read/ someinformation). But in case you have access to web site source it would be better to create some WCF service or ASHX and use it you can send any data and get result of operation.
It is not possibe to click on button without open site. or see Can I fire button click event without firing pageload event?
I am new to Android, i am doing an application where i need to load our existing application in Web-View on Tablet. In the Tablet when i load my application by using Web-View my application is getting loaded in default browser.
How can i load my application in a specific browser[like Chrome or Firefox] in Web-View on Tablet?
In the Tablet when i load my application by using Web-View my application is getting loaded in default browser.
WebView is a widget that you place in the UI of one of your activities. It is not the default browser.
If you are calling loadUrl() on the WebView, and it is bringing up the default browser, that is because the Web server is issuing a redirect. You can add a WebViewClient to your app to handle this, as is discussed here: https://stackoverflow.com/a/8941605/115145
How can i load my application in a specific browser[like Chrome or Firefox] in Web-View on Tablet?
If you really do want to load content into a Web browser, you let the user choose what browser the user wishes to use. Typically, this will happen automatically when you launch a URL (e.g., via startActivity() on an ACTION_VIEW Intent) -- if there is more than one browser, and they have not set a default, the user will be presented with a chooser to pick which browser they wish to use.