Re: [android-developers] Re: Help, eclipse does'nt show any errors, but app does'nt work on phone.

2012-06-20 Thread Lars
I know:-) I have learned something, the time i have been trying to learn this;-)

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


RE: [android-developers] Re: Help, eclipse does'nt show any errors, but app does'nt work on phone.

2012-06-20 Thread Lars
I have a book it is called: hello, android. By Ed Burnette. Its okay:-)

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


Re: [android-developers] Re: Help, eclipse does'nt show any errors, but app does'nt work on phone.

2012-06-20 Thread Justin Anderson
Looking over my code real quick, I noticed that I forgot to call
setContentView() in the onCreate() method of the example I gave you...

Make sure you call that method before you do anything with the buttons (or
any other views in your code as well)...

Thanks,
Justin Anderson
MagouyaWare Developer
http://sites.google.com/site/magouyaware


On Wed, Jun 20, 2012 at 1:43 PM, Tommy Hartz  wrote:

> If you have any question feel free to email me off list and I'll see what I
> can do to help you.
>
> -Original Message-
> From: android-developers@googlegroups.com
> [mailto:android-developers@googlegroups.com] On Behalf Of Lars
> Sent: Wednesday, June 20, 2012 3:33 PM
> To: android-developers@googlegroups.com
> Subject: Re: [android-developers] Re: Help, eclipse does'nt show any
> errors,
> but app does'nt work on phone.
>
> That's okay dude:-)
>
> --
> You received this message because you are subscribed to the Google Groups
> "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
>

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

RE: [android-developers] Re: Help, eclipse does'nt show any errors, but app does'nt work on phone.

2012-06-20 Thread Tommy Hartz
If you have any question feel free to email me off list and I'll see what I
can do to help you.

-Original Message-
From: android-developers@googlegroups.com
[mailto:android-developers@googlegroups.com] On Behalf Of Lars
Sent: Wednesday, June 20, 2012 3:33 PM
To: android-developers@googlegroups.com
Subject: Re: [android-developers] Re: Help, eclipse does'nt show any errors,
but app does'nt work on phone.

That's okay dude:-)

--
You received this message because you are subscribed to the Google Groups
"Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


Re: [android-developers] Re: Help, eclipse does'nt show any errors, but app does'nt work on phone.

2012-06-20 Thread Justin Anderson
You probably want to take one of the following approaches... Note that my
code is overly-simplified, I did not verify that it doesn't contain compile
errors (I just typed it up real quick in this email), and you will have to
customize it to suit your needs:

*Method 1:*

public class MyActivity extends Activity
{
 private Button m_btn1;
 private Button m_btn2;

 public void onCreate(Bundle bundle)
 {
  super.onCreate(bundle)

  //Set the click listener for the first button
  m_btn1 = findViewById(R.id.first_button_id);
  m_btn1.setOnClickListener(new View.OnClickListener() {
   public void onClick(View v) {
//Do stuff for the click of m_btn1
   }
  });

  //Set the click listener for the second button
  m_btn2 = findViewById(R.id.second_button_id);
  m_btn2.setOnClickListener(new View.OnClickListener() {
   public void onClick(View v) {
//Do stuff for the click of m_btn2
   }
  });
 }
}

*Method 2:*

public class MyActivity extends Activity implements View.OnClickListener
{
 private Button m_btn1;
 private Button m_btn2;

 public void onCreate(Bundle bundle)
 {
  super.onCreate(bundle)

  //Set the click listener for the first button
  m_btn1 = findViewById(R.id.first_button_id);
  m_btn1.setOnClickListener(this);

  //Set the click listener for the second button
  m_btn2 = findViewById(R.id.second_button_id);
  m_btn2.setOnClickListener(this);
 }

 public void onClick(View v)
 {
  if (v == m_btn1)
  {
   //Do stuff for the click of m_btn1
  }
  else if (v == m_btn2)
  {
   //Do stuff for the click of m_btn2
  }
 }
}

Hope that helps clear up some things

Thanks,
Justin Anderson
MagouyaWare Developer
http://sites.google.com/site/magouyaware


On Wed, Jun 20, 2012 at 1:28 PM, Justin Anderson wrote:

> Sorry Lars... my post was overly harsh.  As mentioned before, the
> assumption is that you already have a reasonable amount of programming
> experience.
>
> I will post the correct way to do what you are after in just a little
> bit...
>
>
> Thanks,
> Justin Anderson
> MagouyaWare Developer
> http://sites.google.com/site/magouyaware
>
>
> On Wed, Jun 20, 2012 at 1:16 PM, Lars  wrote:
>
>> Thank you I really appreciate you post=) I just misunderstood the point
>> of this forum. You know any beginner forums?(english or danish).
>>
>> Den onsdag den 20. juni 2012 21.08.36 UTC+2 skrev Nobu Games:
>>
>>> Hey Lars, good to see that you want to learn programming at your young
>>> age and picked Android for doing your first few steps. It's a great choice
>>> for that, in my opinion.
>>>
>>> But you need to understand that this forum is not meant to answer
>>> beginner questions. We actually assume that you already know programming
>>> and especially Java by your heart. And all your questions here clearly show
>>> that you still have quite some way to go.
>>>
>>> You should try and find a beginners level Java forum where people are
>>> glad to help you out with your questions.
>>>
>>> But anyway, keep up your spirit. I think playing around with existing
>>> code samples is the way to go.
>>>
>>>
>>> On Wednesday, June 20, 2012 1:53:26 PM UTC-5, Lars wrote:

 Eclipse (of some reason) tells me to type them, or i will get errors.
 I'm very new at making apps(+ I do this in my free time I'am fifteen
 years old).
 All  do is: I read in my book trying to type in eclipse, and then i try
 to get help from here.

>>>  --
>> You received this message because you are subscribed to the Google
>> Groups "Android Developers" group.
>> To post to this group, send email to android-developers@googlegroups.com
>> To unsubscribe from this group, send email to
>> android-developers+unsubscr...@googlegroups.com
>> For more options, visit this group at
>> http://groups.google.com/group/android-developers?hl=en
>>
>
>

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

RE: [android-developers] Re: Help, eclipse does'nt show any errors, but app does'nt work on phone.

2012-06-20 Thread Tommy Hartz
I too would recommend getting the feel for java and at least understand the
basics of classes and syntax. Then I would recommend getting a Book "
Beginning Android" by Mark L. Murphy the ISBN is 978-1-4302-2419-8 

 

This book really helped me out and I only had a basic understanding of java,
although I have had previous programming experience in VB.

 

From: android-developers@googlegroups.com
[mailto:android-developers@googlegroups.com] On Behalf Of Lars
Sent: Wednesday, June 20, 2012 3:16 PM
To: android-developers@googlegroups.com
Subject: Re: [android-developers] Re: Help, eclipse does'nt show any errors,
but app does'nt work on phone.

 

Thank you I really appreciate you post=) I just misunderstood the point of
this forum. You know any beginner forums?(english or danish).

Den onsdag den 20. juni 2012 21.08.36 UTC+2 skrev Nobu Games:

Hey Lars, good to see that you want to learn programming at your young age
and picked Android for doing your first few steps. It's a great choice for
that, in my opinion. 

But you need to understand that this forum is not meant to answer beginner
questions. We actually assume that you already know programming and
especially Java by your heart. And all your questions here clearly show that
you still have quite some way to go.

You should try and find a beginners level Java forum where people are glad
to help you out with your questions.

But anyway, keep up your spirit. I think playing around with existing code
samples is the way to go.


On Wednesday, June 20, 2012 1:53:26 PM UTC-5, Lars wrote:

Eclipse (of some reason) tells me to type them, or i will get errors. 

I'm very new at making apps(+ I do this in my free time I'am fifteen years
old).

All  do is: I read in my book trying to type in eclipse, and then i try to
get help from here.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Re: [android-developers] Re: Help, eclipse does'nt show any errors, but app does'nt work on phone.

2012-06-20 Thread Lars
That's okay dude:-)

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


Re: [android-developers] Re: Help, eclipse does'nt show any errors, but app does'nt work on phone.

2012-06-20 Thread Justin Anderson
Sorry Lars... my post was overly harsh.  As mentioned before, the
assumption is that you already have a reasonable amount of programming
experience.

I will post the correct way to do what you are after in just a little bit...

Thanks,
Justin Anderson
MagouyaWare Developer
http://sites.google.com/site/magouyaware


On Wed, Jun 20, 2012 at 1:16 PM, Lars  wrote:

> Thank you I really appreciate you post=) I just misunderstood the point of
> this forum. You know any beginner forums?(english or danish).
>
> Den onsdag den 20. juni 2012 21.08.36 UTC+2 skrev Nobu Games:
>
>> Hey Lars, good to see that you want to learn programming at your young
>> age and picked Android for doing your first few steps. It's a great choice
>> for that, in my opinion.
>>
>> But you need to understand that this forum is not meant to answer
>> beginner questions. We actually assume that you already know programming
>> and especially Java by your heart. And all your questions here clearly show
>> that you still have quite some way to go.
>>
>> You should try and find a beginners level Java forum where people are
>> glad to help you out with your questions.
>>
>> But anyway, keep up your spirit. I think playing around with existing
>> code samples is the way to go.
>>
>>
>> On Wednesday, June 20, 2012 1:53:26 PM UTC-5, Lars wrote:
>>>
>>> Eclipse (of some reason) tells me to type them, or i will get errors.
>>> I'm very new at making apps(+ I do this in my free time I'am fifteen
>>> years old).
>>> All  do is: I read in my book trying to type in eclipse, and then i try
>>> to get help from here.
>>>
>>  --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
>

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Re: [android-developers] Re: Help, eclipse does'nt show any errors, but app does'nt work on phone.

2012-06-20 Thread Lars
Thank you I really appreciate you post=) I just misunderstood the point of 
this forum. You know any beginner forums?(english or danish).

Den onsdag den 20. juni 2012 21.08.36 UTC+2 skrev Nobu Games:
>
> Hey Lars, good to see that you want to learn programming at your young age 
> and picked Android for doing your first few steps. It's a great choice for 
> that, in my opinion. 
>
> But you need to understand that this forum is not meant to answer beginner 
> questions. We actually assume that you already know programming and 
> especially Java by your heart. And all your questions here clearly show 
> that you still have quite some way to go.
>
> You should try and find a beginners level Java forum where people are glad 
> to help you out with your questions.
>
> But anyway, keep up your spirit. I think playing around with existing code 
> samples is the way to go.
>
>
> On Wednesday, June 20, 2012 1:53:26 PM UTC-5, Lars wrote:
>>
>> Eclipse (of some reason) tells me to type them, or i will get errors. 
>> I'm very new at making apps(+ I do this in my free time I'am fifteen 
>> years old).
>> All  do is: I read in my book trying to type in eclipse, and then i try 
>> to get help from here.
>>
>

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Re: [android-developers] Re: Help, eclipse does'nt show any errors, but app does'nt work on phone.

2012-06-20 Thread Nobu Games
Hey Lars, good to see that you want to learn programming at your young age 
and picked Android for doing your first few steps. It's a great choice for 
that, in my opinion. 

But you need to understand that this forum is not meant to answer beginner 
questions. We actually assume that you already know programming and 
especially Java by your heart. And all your questions here clearly show 
that you still have quite some way to go.

You should try and find a beginners level Java forum where people are glad 
to help you out with your questions.

But anyway, keep up your spirit. I think playing around with existing code 
samples is the way to go.


On Wednesday, June 20, 2012 1:53:26 PM UTC-5, Lars wrote:
>
> Eclipse (of some reason) tells me to type them, or i will get errors. 
> I'm very new at making apps(+ I do this in my free time I'am fifteen years 
> old).
> All  do is: I read in my book trying to type in eclipse, and then i try to 
> get help from here.
>

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Re: [android-developers] Re: Help, eclipse does'nt show any errors, but app does'nt work on phone.

2012-06-20 Thread Lars
Eclipse (of some reason) tells me to type them, or i will get errors. 
I'm very new at making apps(+ I do this in my free time I'am fifteen years 
old).
All  do is: I read in my book trying to type in eclipse, and then i try to 
get help from here.

Den onsdag den 20. juni 2012 20.24.13 UTC+2 skrev MagouyaWare:
>
> I would love it if you told me all the errors I made it would really help 
>> me =).
>>
>> But do you mean like this:
>> final Button dagens_button = (Button) findViewById(R.id.dagens_button);
>> dagens_button.setOnClickListener(new View.OnClickListener() {
>> public void onClick(View v) {
>> switch (v.getId()){
>> case R.id.dagens_button:
>> *final Button nyeste_button = (Button) findViewById(R.id.nyeste_button);*
>> Intent i = new Intent(BrowserActivity.this, dagensbilde.class);;
>> startActivity(i);
>> switch (v.getId()){
>> case R.id.nyeste_button:
>>  Intent i1 = new Intent(BrowserActivity.this, 
>> nyestebilde.class);;
>>  startActivity(i1);
>>  break;
>> }
>> // Perform action on click
>> }
>> {;
>> }{; 
>>
> }};;;{;;;};});}}
>>
>
> I don't do this very often... but WTF??
>
>- What in the world are all the braces and semi-colons for?
>- Why are you nesting switch statements?
>- Why do you even have a switch statement if there is only one case?
>- You are still not setting a click listener on nyeste_buttton... 
>- Even if you did, you wouldn't be setting it until AFTER you clicked 
>on dagens_button...
>- Need I go on?
>
>
>
> Thanks,
> Justin Anderson
> MagouyaWare Developer
> http://sites.google.com/site/magouyaware
>
>
> On Wed, Jun 20, 2012 at 12:16 PM, Lars  wrote:
>
>> I would love it if you told me all the errors I made it would really help 
>> me =).
>>
>> But do you mean like this:
>> final Button dagens_button = (Button) findViewById(R.id.dagens_button);
>> dagens_button.setOnClickListener(new View.OnClickListener() {
>> public void onClick(View v) {
>> switch (v.getId()){
>> case R.id.dagens_button:
>> *final Button nyeste_button = (Button) findViewById(R.id.nyeste_button);*
>>  Intent i = new Intent(BrowserActivity.this, dagensbilde.class);;
>> startActivity(i);
>> switch (v.getId()){
>> case R.id.nyeste_button:
>>  Intent i1 = new Intent(BrowserActivity.this, 
>> nyestebilde.class);;
>>  startActivity(i1);
>>  break;
>> }
>> // Perform action on click
>> }
>> {;
>> }{;
>> }};;;{;;;};});}}
>>
>
>

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Re: [android-developers] Re: Help, eclipse does'nt show any errors, but app does'nt work on phone.

2012-06-20 Thread Justin Anderson
>
> I would love it if you told me all the errors I made it would really help
> me =).
>
> But do you mean like this:
> final Button dagens_button = (Button) findViewById(R.id.dagens_button);
> dagens_button.setOnClickListener(new View.OnClickListener() {
> public void onClick(View v) {
> switch (v.getId()){
> case R.id.dagens_button:
> *final Button nyeste_button = (Button) findViewById(R.id.nyeste_button);*
> Intent i = new Intent(BrowserActivity.this, dagensbilde.class);;
> startActivity(i);
> switch (v.getId()){
> case R.id.nyeste_button:
>  Intent i1 = new Intent(BrowserActivity.this,
> nyestebilde.class);;
>  startActivity(i1);
>  break;
> }
> // Perform action on click
> }
> {;
> }{;
>
}};;;{;;;};});}}
>

I don't do this very often... but WTF??

   - What in the world are all the braces and semi-colons for?
   - Why are you nesting switch statements?
   - Why do you even have a switch statement if there is only one case?
   - You are still not setting a click listener on nyeste_buttton...
   - Even if you did, you wouldn't be setting it until AFTER you clicked on
   dagens_button...
   - Need I go on?



Thanks,
Justin Anderson
MagouyaWare Developer
http://sites.google.com/site/magouyaware


On Wed, Jun 20, 2012 at 12:16 PM, Lars  wrote:

> I would love it if you told me all the errors I made it would really help
> me =).
>
> But do you mean like this:
> final Button dagens_button = (Button) findViewById(R.id.dagens_button);
> dagens_button.setOnClickListener(new View.OnClickListener() {
> public void onClick(View v) {
> switch (v.getId()){
> case R.id.dagens_button:
> *final Button nyeste_button = (Button) findViewById(R.id.nyeste_button);*
>  Intent i = new Intent(BrowserActivity.this, dagensbilde.class);;
> startActivity(i);
> switch (v.getId()){
> case R.id.nyeste_button:
>  Intent i1 = new Intent(BrowserActivity.this,
> nyestebilde.class);;
>  startActivity(i1);
>  break;
> }
> // Perform action on click
> }
> {;
> }{;
> }};;;{;;;};});}}
>

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Re: [android-developers] Re: Help, eclipse does'nt show any errors, but app does'nt work on phone.

2012-06-20 Thread Lars
I would love it if you told me all the errors I made it would really help 
me =).

But do you mean like this:
final Button dagens_button = (Button) findViewById(R.id.dagens_button);
dagens_button.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
switch (v.getId()){
case R.id.dagens_button:
*final Button nyeste_button = (Button) findViewById(R.id.nyeste_button);*
Intent i = new Intent(BrowserActivity.this, dagensbilde.class);;
startActivity(i);
switch (v.getId()){
case R.id.nyeste_button:
 Intent i1 = new Intent(BrowserActivity.this, 
nyestebilde.class);;
 startActivity(i1);
 break;
}
// Perform action on click
}
{;
}{;
}};;;{;;;};});}}

Den onsdag den 20. juni 2012 18.53.51 UTC+2 skrev MagouyaWare:
>
> And also, your use of switch statements is seriously flawed...  But that 
> has nothing to do with the actual problem you are having.
>
> Thanks,
> Justin Anderson
> MagouyaWare Developer
> http://sites.google.com/site/magouyaware
>
>
> On Wed, Jun 20, 2012 at 10:52 AM, Justin Anderson 
> wrote:
>
>> That is because your click listener ONLY exists for the dagens_button...  
>> You are using an anonymous class on dagens_button.  Thus, that is the only 
>> view that will ever get the onClick event and you can take the case 
>> statement out.
>>
>> Do the same thing for nyeste_button and it will work...
>>
>>
>> Thanks,
>> Justin Anderson
>> MagouyaWare Developer
>> http://sites.google.com/site/magouyaware
>>
>>
>> On Wed, Jun 20, 2012 at 10:35 AM, Lars  wrote:
>>
>>> Hello out there.
>>>
>>> In my application I have 5 buttons, but i can only make 1 one of them 
>>> work(well i've only tried with 2 buttons =))
>>> Eclipse doesn't show any errors, but nothing happens when i press the 
>>> nyeste_button.
>>>
>>> final Button dagens_button = (Button) findViewById(R.id.dagens_button);
>>> dagens_button.setOnClickListener(new View.OnClickListener() {
>>> public void onClick(View v) {
>>> switch (v.getId()){
>>> case R.id.dagens_button:
>>> Intent i = new Intent(BrowserActivity.this, dagensbilde.class);;
>>> startActivity(i);
>>> switch (v.getId()){
>>>  case R.id.nyeste_button:
>>>  Intent i1 = new Intent(BrowserActivity.this, 
>>> nyestebilde.class);;
>>>  startActivity(i1);
>>>  break;
>>> }
>>> // Perform action on click
>>> }
>>> {;
>>> }{;
>>> }};;;{;;;};});}}
>>>
>>>  
>>>
>>> Den torsdag den 7. juni 2012 21.21.26 UTC+2 skrev Lars:
>>>
 Hello
 I am new at this site and new at developing.
 The first activity in my application has 5 buttons, every one of them 
 should(at som point when I get it done) lead to a web page using the 
 "webview" wigdet. Eclipse does'nt show any errors or mistakes in the code 
 ANYWHERE.

 BUT, when I try to run the app on my phone it only shows my background 
 color and the applications name.

 This is what Eclipse shows (picture is taken with my phone) in main.xml

 
 This is what my phone shows: as you can see theres something wrong. but 
 what? please help me. Thanks, Lars.

 

>>>  -- 
>>> You received this message because you are subscribed to the Google
>>> Groups "Android Developers" group.
>>> To post to this group, send email to android-developers@googlegroups.com
>>> To unsubscribe from this group, send email to
>>> android-developers+unsubscr...@googlegroups.com
>>> For more options, visit this group at
>>> http://groups.google.com/group/android-developers?hl=en
>>>
>>
>>
>

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Re: [android-developers] Re: Help, eclipse does'nt show any errors, but app does'nt work on phone.

2012-06-20 Thread Justin Anderson
And also, your use of switch statements is seriously flawed...  But that
has nothing to do with the actual problem you are having.

Thanks,
Justin Anderson
MagouyaWare Developer
http://sites.google.com/site/magouyaware


On Wed, Jun 20, 2012 at 10:52 AM, Justin Anderson wrote:

> That is because your click listener ONLY exists for the dagens_button...
> You are using an anonymous class on dagens_button.  Thus, that is the only
> view that will ever get the onClick event and you can take the case
> statement out.
>
> Do the same thing for nyeste_button and it will work...
>
>
> Thanks,
> Justin Anderson
> MagouyaWare Developer
> http://sites.google.com/site/magouyaware
>
>
> On Wed, Jun 20, 2012 at 10:35 AM, Lars  wrote:
>
>> Hello out there.
>>
>> In my application I have 5 buttons, but i can only make 1 one of them
>> work(well i've only tried with 2 buttons =))
>> Eclipse doesn't show any errors, but nothing happens when i press the
>> nyeste_button.
>>
>> final Button dagens_button = (Button) findViewById(R.id.dagens_button);
>> dagens_button.setOnClickListener(new View.OnClickListener() {
>> public void onClick(View v) {
>> switch (v.getId()){
>> case R.id.dagens_button:
>> Intent i = new Intent(BrowserActivity.this, dagensbilde.class);;
>> startActivity(i);
>> switch (v.getId()){
>>  case R.id.nyeste_button:
>>  Intent i1 = new Intent(BrowserActivity.this,
>> nyestebilde.class);;
>>  startActivity(i1);
>>  break;
>> }
>> // Perform action on click
>> }
>> {;
>> }{;
>> }};;;{;;;};});}}
>>
>>
>>
>> Den torsdag den 7. juni 2012 21.21.26 UTC+2 skrev Lars:
>>
>>> Hello
>>> I am new at this site and new at developing.
>>> The first activity in my application has 5 buttons, every one of them
>>> should(at som point when I get it done) lead to a web page using the
>>> "webview" wigdet. Eclipse does'nt show any errors or mistakes in the code
>>> ANYWHERE.
>>>
>>> BUT, when I try to run the app on my phone it only shows my background
>>> color and the applications name.
>>>
>>> This is what Eclipse shows (picture is taken with my phone) in main.xml
>>>
>>> 
>>> This is what my phone shows: as you can see theres something wrong. but
>>> what? please help me. Thanks, Lars.
>>>
>>> 
>>>
>>  --
>> You received this message because you are subscribed to the Google
>> Groups "Android Developers" group.
>> To post to this group, send email to android-developers@googlegroups.com
>> To unsubscribe from this group, send email to
>> android-developers+unsubscr...@googlegroups.com
>> For more options, visit this group at
>> http://groups.google.com/group/android-developers?hl=en
>>
>
>

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Re: [android-developers] Re: Help, eclipse does'nt show any errors, but app does'nt work on phone.

2012-06-20 Thread Justin Anderson
That is because your click listener ONLY exists for the dagens_button...
You are using an anonymous class on dagens_button.  Thus, that is the only
view that will ever get the onClick event and you can take the case
statement out.

Do the same thing for nyeste_button and it will work...

Thanks,
Justin Anderson
MagouyaWare Developer
http://sites.google.com/site/magouyaware


On Wed, Jun 20, 2012 at 10:35 AM, Lars  wrote:

> Hello out there.
>
> In my application I have 5 buttons, but i can only make 1 one of them
> work(well i've only tried with 2 buttons =))
> Eclipse doesn't show any errors, but nothing happens when i press the
> nyeste_button.
>
> final Button dagens_button = (Button) findViewById(R.id.dagens_button);
> dagens_button.setOnClickListener(new View.OnClickListener() {
> public void onClick(View v) {
> switch (v.getId()){
> case R.id.dagens_button:
> Intent i = new Intent(BrowserActivity.this, dagensbilde.class);;
> startActivity(i);
> switch (v.getId()){
> case R.id.nyeste_button:
>  Intent i1 = new Intent(BrowserActivity.this,
> nyestebilde.class);;
>  startActivity(i1);
>  break;
> }
> // Perform action on click
> }
> {;
> }{;
> }};;;{;;;};});}}
>
>
>
> Den torsdag den 7. juni 2012 21.21.26 UTC+2 skrev Lars:
>
>> Hello
>> I am new at this site and new at developing.
>> The first activity in my application has 5 buttons, every one of them
>> should(at som point when I get it done) lead to a web page using the
>> "webview" wigdet. Eclipse does'nt show any errors or mistakes in the code
>> ANYWHERE.
>>
>> BUT, when I try to run the app on my phone it only shows my background
>> color and the applications name.
>>
>> This is what Eclipse shows (picture is taken with my phone) in main.xml
>>
>> 
>> This is what my phone shows: as you can see theres something wrong. but
>> what? please help me. Thanks, Lars.
>>
>> 
>>
>  --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
>

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en