Найдено 5 результатов

Anikey82
17 окт 2015, 07:56
Форум: Экранные компоненты
Тема: WebView и .html в assets
Ответы: 5
Просмотры: 3104

Re: WebView и .html в assets

Сделал так: String webData = null; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); webData = getHtmlFromAsset(); WebView webView = (WebView) findViewById(R.id.webview); webView.getSettings().setJavaScriptEnabl...
Anikey82
08 окт 2015, 15:55
Форум: Экранные компоненты
Тема: WebView и .html в assets
Ответы: 5
Просмотры: 3104

Re: WebView и .html в assets

private class MyWebViewClient extends WebViewClient { @Override //show the web page in webview but not in web browser public boolean shouldOverrideUrlLoading(WebView view, String url) { WebView localWebView = (WebView) findViewById(R.id.webview); localWebView.getSettings().setJavaScriptEnabled(true...
Anikey82
29 сен 2015, 18:00
Форум: Экранные компоненты
Тема: WebView и .html в assets
Ответы: 5
Просмотры: 3104

Re: WebView и .html в assets

В строке WebView localWebView = (WebView) findViewById(R.id.webview); ошибка( private class MyWebViewClient extends WebViewClient { @Override //show the web page in webview but not in web browser public boolean shouldOverrideUrlLoading(WebView view, String url) { view.loadUrl(url); return true; WebV...
Anikey82
29 сен 2015, 14:18
Форум: Экранные компоненты
Тема: WebView и .html в assets
Ответы: 5
Просмотры: 3104

WebView и .html в assets

Как загрузить локальный файл.html из assets в WebView? Через loadUrl получается, но тогда не работают ссылки на другие файлы, нашел, что нужно через loadDataWithBaseURL, но этот код не работает. public class MainActivity extends AppCompatActivity { private WebView text; String summary = "<html><body...
Anikey82
09 авг 2015, 15:58
Форум: Уроки
Тема: Урок 71. Preferences как настройки приложения. PreferenceActivity
Ответы: 48
Просмотры: 52876

Re: Урок 71. Preferences как настройки приложения. Preferenc

При нажатии на настройки закрывается с ошибкой, в чем может быть причина? MainActivity @Override public boolean onOptionsItemSelected(MenuItem item) { // Pass the event to ActionBarDrawerToggle, if it returns // true, then it has handled the app icon touch event if (mDrawerToggle.onOptionsItemSelect...