-1

I am new to Eclipse and androids app.

I want a simple app to Androids phones. User starts this app and will directly been redirected to my homesite www.mypage.com

Can Someone help me? I try to use Eclipse to make this..

Salandur
  • 6,283
  • 2
  • 20
  • 23
Henrik
  • 5
  • 3
  • Eclipse is IDE and really doesn't matter here ... you should learn some android basics like what is `Intent` and how to use it – Selvin Aug 20 '14 at 10:20
  • possible duplicate of [How can I open a URL in Android's web browser from my application?](http://stackoverflow.com/questions/2201917/how-can-i-open-a-url-in-androids-web-browser-from-my-application) – Selvin Aug 20 '14 at 10:23
  • Do you want to open a url / website in your app's first screen ? – LomE999 Aug 20 '14 at 10:35
  • Yes Rose, i want to open a url directly – Henrik Aug 20 '14 at 10:50

1 Answers1

0

create a new Android project . File New Android Application Project choose defaults and then in your MainActivity class: @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main);

    if (savedInstanceState == null) {
        getSupportFragmentManager().beginTransaction()
                .add(R.id.container, new PlaceholderFragment()).commit();
    }
    // add these two lines

Intent browserIntent = new Intent(Intent.ACTION_VIEW,Uri.parse("http://www.mypage.com")); startActivity(browserIntent); }

NavinRaj Pandey
  • 1,572
  • 2
  • 22
  • 35
  • you may need to import these two as well import android.content.Intent; import android.net.Uri; – NavinRaj Pandey Aug 20 '14 at 10:23
  • I get error in this line: .add(R.id.container, new PlaceholderFragment()).commit(); PlaceholderFragment cannot be resolved to a type container cannot be resolved or is not a field – Henrik Aug 20 '14 at 11:43
  • control+z everything if you copied my whole code .. just copy the two last two lines inside your onCreate() method – NavinRaj Pandey Aug 20 '14 at 11:45
  • Where can i find "onCreate()" Is it in here: public boolean onCreateOptionsMenu(Menu menu) {} – Henrik Aug 20 '14 at 13:33