Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,154,350 members, 7,822,662 topics. Date: Thursday, 09 May 2024 at 02:40 PM

ANDROID VIEW - Programming - Nairaland

Nairaland Forum / Science/Technology / Programming / ANDROID VIEW (1500 Views)

Help Me Solve This Java / Guys Pleaseeeee I Need To Understand This Java Thing! / Improve The Speed Of This Java Code. (2) (3) (4)

(1) (Reply) (Go Down)

ANDROID VIEW by Nobody: 4:22pm On Dec 01, 2015
MainActivity.java
package com.example.proxze;
import
android.annotation.SuppressLint;
import android.app.Activity;
import android.os.Bundle;
import android.webkit.WebView;
@SuppressLint
("SetJavaScriptEnabled" )
public class MainActivty extends
Activity {
private WebView webView;
public void onCreate(Bundle
savedInstanceState) {
super.onCreate
(savedInstanceState);
setContentView
(R.layout.activity_main);
webView = (WebView)
findViewById
(R.id.action_settings);
webView.getSettings
().setJavaScriptEnabled(true);
webView.loadUrl("http://
www.proxze.com");
}
}





MainAcivity.xml
<?xml version="1.0"
encoding="utf-8"?>
<LinearLayout
xmlns:android="http://
schemas.android.com/apk/res/
android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
>
<WebView
android:id="@+id/webView1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
/>
Re: ANDROID VIEW by Nobody: 4:26pm On Dec 01, 2015
The code is not complete
Re: ANDROID VIEW by Urine: 5:19pm On Dec 01, 2015
proxy20:
The code is not complete
Why did you give the layout file a different name?
Re: ANDROID VIEW by Nobody: 5:33pm On Dec 01, 2015
The R.layout.weview1 can't be the layout it will give you errors . I am trying to add another xml file to the codes .
Re: ANDROID VIEW by seunthomas: 6:10pm On Dec 01, 2015
Change your layout file from MainAcivity.xml to activity_main.xml or change this line
setContentView(R.layout.activity_main);
to
setContentView(R.layout.MainAcivity);

Also change this line
webView = (WebView)findViewById(R.id.action_settings);
to
webView = (WebView)findViewById(R.id. webView1);

And you should be ok
ensure you close your layout xml file properly
it should be something like this


<?xml version="1.0"
encoding="utf-8"?>
<LinearLayout
xmlns:android="http://
schemas.android.com/apk/res/
android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
>
<WebView
android:id="@+id/webView1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
/>
</LinearLayout>
Re: ANDROID VIEW by Nobody: 6:13pm On Dec 01, 2015
I will try it thanks . Still learning some stuff about android transition . I am having problems with the running the code it gives unable to lunch because of some errors .

Re: ANDROID VIEW by Urine: 9:39pm On Dec 01, 2015
seunthomas:
Change your layout file from MainAcivity.xml to activity_main.xml or change this line
setContentView(R.layout.activity_main);
to
setContentView(R.layout.MainAcivity);

Also change this line
webView = (WebView)findViewById(R.id.action_settings);
to
webView = (WebView)findViewById(R.id. webView1);

And you should be ok
ensure you close your layout xml file properly
it should be something like this


<?xml version="1.0"
encoding="utf-8"?>
<LinearLayout
xmlns:android="http://
schemas.android.com/apk/res/
android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
>
<WebView
android:id="@+id/webView1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
/>
</LinearLayout>


Re: ANDROID VIEW by DonaldGenes(m): 12:28am On Dec 02, 2015
proxy20:
I will try it thanks . Still learning some stuff about android transition . I am having problems with the running the code it gives unable to lunch because of some errors .
lolzz! See how you are struggling to develop a your website in webview. You still have long way to go.you never even talk of adding spalsh screen.Anyway? ICan do that for you with less cost.
With some added features professionally before friday or sat..You have your app ready
Tripdarlinq@gmail.com or call 0803893811?
Re: ANDROID VIEW by Knownpal(m): 8:26am On Dec 02, 2015
DonaldGenes:

lolzz! See how you are struggling to develop a your website in webview. You still have long way to go.you never even talk of adding splash screen.Anyway? ICan do that for you with less cost.
With some added features professionally before friday or sat..You have your app ready
Tripdarlinq@gmail.com or call 0803893811?

He said he's learning. Not a school project.
Re: ANDROID VIEW by Nobody: 12:23pm On Dec 02, 2015
I could have use html ,css ,jquery mobile and ajax to send request
Re: ANDROID VIEW by zubysnook: 12:48am On Dec 11, 2015
I
Re: ANDROID VIEW by Nobody: 8:16am On Dec 11, 2015
Instead of loading it is redirecting to a browser .
how can I override that setup .

Re: ANDROID VIEW by Knownpal(m): 2:46pm On Dec 11, 2015
You need to handle this intent "android.intent.action.WEB_SEARCH" in your manifest file.
Re: ANDROID VIEW by Nobody: 2:52pm On Dec 11, 2015
I will try it .
<intent-filter>
<action android:name="android.intent.action.WEB_SEARCH" />
Re: ANDROID VIEW by Nobody: 4:09pm On Dec 11, 2015
I didn't import material design library . The screen size is not well calculated . I add the line of xml code it was unable to override the browser so I added some code to the java class. see the outcome. I could have use master detail flow activity .it will be a better option .

Re: ANDROID VIEW by Nobody: 6:58am On Dec 12, 2015

(1) (Reply)

How Messaging And Social Apps Helped Convict Adam Johnson / Tigerjs My Personal Javascript Library Project / Download Mumu App Player

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 19
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.