androidandroid-activityandroid-webviewweb-scrapingintentservice

Android: Using WebView outside an Activity context


I am trying to achieve Web Scraping through a background IntentService that periodically scrape a website without a view displaying on the users phone.

Is there any way of working around this problem?


Solution

  • Correct me if I am wrong but the correct answer to this question is that there is NO possible way to use a WebView in the background while the user is doing other things on the phone without interrupting the user by means of an Activity.

    I have applied both Randy and Code_Yoga's suggestions: Using an activity with "Theme.NoDisplay" to launch a background service with a WebView to do some work. However even though no view is visible the switching to that activity for that second to start the services interrupts the user (ex. like pausing a running game that was being played).

    Totally disastrous news for my app so I am still hoping someone will give me a way to use a WebView that does not need an Activity (or a substitute for a WebView that can accomplish the same)