[android-developers] Re: Adding a new View causing Force Close

2011-02-12 Thread Indicator Veritatis
Indeed: there is even a pretty good tutorial specifically on using the
Eclipse debugger at http://www.ibm.com/developerworks/library/os-ecbug/.

A source on more generic Eclipse topics is:
http://www.linuxtopia.org/online_books/eclipse_documentation/eclipse_workbench_user_guide/index.html

On Feb 10, 5:41 pm, TreKing  wrote:
> On Thu, Feb 10, 2011 at 7:35 PM, Aaron Buckner  wrote:
> > Thanks for taking the time to look at this and help me.
>
> > 1. I'm not sure what you mean/how to "step through the debugger"
>
> I'm assuming you're using Eclipse. If you don't know what this means, you
> really need to spend some time learning this. Google "Eclipse Debugger" and
> you should get plenty of information.
>
> > 2. I figured you meant that my view was not defined
>
> > 3.  Here is the XML layout:
>
> OK, that's a LinearLayout with the specified ID. Where is *this* layout
> contained? Where's the parent? And what does your call to setContentView()
> look like?
>
> -
> TreKing  - Chicago
> transit tracking app for Android-powered devices

-- 
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


[android-developers] Re: Adding a new View causing Force Close

2011-02-10 Thread Aaron Buckner
For those that may stumble upon this later I neglected to literally
"include" the xml in the main views xml



On Feb 10, 8:59 pm, Aaron Buckner  wrote:
> Nope!!! I knew I was missing something simple THANK YOU for your time!
> Thats what I get for taking a couple days off and getting out of
> town... you forget the simple stuff
>
> On Feb 10, 8:49 pm, TreKing  wrote:
>
>
>
>
>
>
>
> > On Thu, Feb 10, 2011 at 7:45 PM, Aaron Buckner  wrote:
> > > The layout is contained in its own xml file labeled owners.xml I tend
> > > to seperate each view into separate xml files to keep it easier to
> > > manage.
>
> > That's good practice.
>
> > >        setContentView(R.layout.dashboard);
>
> > Here, this "dashboard" layout, this includes the "owners" layout somehow?
>
> > --- 
> > --
> > TreKing  - Chicago
> > transit tracking app for Android-powered devices

-- 
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


[android-developers] Re: Adding a new View causing Force Close

2011-02-10 Thread Aaron Buckner
Nope!!! I knew I was missing something simple THANK YOU for your time!
Thats what I get for taking a couple days off and getting out of
town... you forget the simple stuff

On Feb 10, 8:49 pm, TreKing  wrote:
> On Thu, Feb 10, 2011 at 7:45 PM, Aaron Buckner  wrote:
> > The layout is contained in its own xml file labeled owners.xml I tend
> > to seperate each view into separate xml files to keep it easier to
> > manage.
>
> That's good practice.
>
> >        setContentView(R.layout.dashboard);
>
> Here, this "dashboard" layout, this includes the "owners" layout somehow?
>
> --- 
> --
> TreKing  - Chicago
> transit tracking app for Android-powered devices

-- 
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: Adding a new View causing Force Close

2011-02-10 Thread TreKing
On Thu, Feb 10, 2011 at 7:45 PM, Aaron Buckner  wrote:

> The layout is contained in its own xml file labeled owners.xml I tend
> to seperate each view into separate xml files to keep it easier to
> manage.
>

That's good practice.


>setContentView(R.layout.dashboard);
>

Here, this "dashboard" layout, this includes the "owners" layout somehow?

-
TreKing  - Chicago
transit tracking app for Android-powered devices

-- 
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

[android-developers] Re: Adding a new View causing Force Close

2011-02-10 Thread Aaron Buckner
Ok I'l spend some more time looking into the debugger tonight (yes
using Eclipse)
The layout is contained in its own xml file labeled owners.xml I tend
to seperate each view into separate xml files to keep it easier to
manage.
here is the other code requested :

/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);

setContentView(R.layout.dashboard);

//Setting the Font for the My Rides section
Typeface tf = Typeface.createFromAsset(getAssets(), "fonts/DS-
DIGIB.TTF");
TextView tv = (TextView) findViewById(R.id.myride_miles);
tv.setTypeface(tf);

Typeface tf2 = Typeface.createFromAsset(getAssets(), "fonts/DS-
DIGIB.TTF");
TextView tv2 = (TextView) findViewById(R.id.myride_mileage);
tv2.setTypeface(tf2);

SharedPreferences prefs =
getSharedPreferences("myDataStorage", MODE_PRIVATE);
ChangeAccent(prefs.getString("accent", "green"));
UpdateMileage();

myRideLV = (ListView)findViewById(R.id.myride_list);
myRideLV.setAdapter(new
ArrayAdapter(this,R.layout.myride_listview, myRideLV_Array));

final View NavDrawer = (View) findViewById(R.id.navigation);
final View HomeScreen = (View) findViewById(R.id.home_screen);
final View MyRideScreen = (View)
findViewById(R.id.myride_screen);
final View OwnerScreen = (View)
findViewById(R.id.owners_screen);

HomeScreen.setVisibility(View.INVISIBLE);
MyRideScreen.setVisibility(View.INVISIBLE);
//OwnerScreen.setVisibility(View.INVISIBLE);








On Feb 10, 8:41 pm, TreKing  wrote:
> On Thu, Feb 10, 2011 at 7:35 PM, Aaron Buckner  wrote:
> > Thanks for taking the time to look at this and help me.
>
> > 1. I'm not sure what you mean/how to "step through the debugger"
>
> I'm assuming you're using Eclipse. If you don't know what this means, you
> really need to spend some time learning this. Google "Eclipse Debugger" and
> you should get plenty of information.
>
> > 2. I figured you meant that my view was not defined
>
> > 3.  Here is the XML layout:
>
> OK, that's a LinearLayout with the specified ID. Where is *this* layout
> contained? Where's the parent? And what does your call to setContentView()
> look like?
>
> --- 
> --
> TreKing  - Chicago
> transit tracking app for Android-powered devices

-- 
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: Adding a new View causing Force Close

2011-02-10 Thread TreKing
On Thu, Feb 10, 2011 at 7:35 PM, Aaron Buckner  wrote:

> Thanks for taking the time to look at this and help me.
>
> 1. I'm not sure what you mean/how to "step through the debugger"
>

I'm assuming you're using Eclipse. If you don't know what this means, you
really need to spend some time learning this. Google "Eclipse Debugger" and
you should get plenty of information.


> 2. I figured you meant that my view was not defined
>
> 3.  Here is the XML layout:
>

OK, that's a LinearLayout with the specified ID. Where is *this* layout
contained? Where's the parent? And what does your call to setContentView()
look like?

-
TreKing  - Chicago
transit tracking app for Android-powered devices

-- 
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

[android-developers] Re: Adding a new View causing Force Close

2011-02-10 Thread Aaron Buckner
Also when I check my R.java.id section under "gen" it shows the
owners_screen id I'm not sure if that helps... it links to

public static final int owners_screen=0x7f070016;

in the R.java file


On Feb 10, 12:50 am, TreKing  wrote:
> On Wed, Feb 9, 2011 at 11:42 PM, Aaron Buckner  wrote:
> > I don't understand how it could be null though
>
> Step 1 - step through your debugger to confirm this.
>
> > I basically copied the statements for MyRideScreen and the XML,
>
> Copying and pasting leads to many errors.
>
> > so I'm confused as to what I'm doing wrong
>
> Your layout, somewhere somehow does not have that view in it.
>
> > If I need to attach more complete code I can do that.
>
> How about the XML layout for what you're setting as the content view?
>
> --- 
> --
> TreKing  - Chicago
> transit tracking app for Android-powered devices

-- 
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


[android-developers] Re: Adding a new View causing Force Close

2011-02-10 Thread Aaron Buckner
Thanks for taking the time to look at this and help me.

1. I'm not sure what you mean/how to "step through the debugger"

2. I figured you meant that my view was not defined

3.  Here is the XML layout:

I've tried something as simple as this:


http://schemas.android.com/apk/res/
android"
android:id="@+id/owners_screen"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>




Conversely something as complex (though I think not too complex) as
this:


http://schemas.android.com/apk/res/
android"
android:id="@+id/owners_screen"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="@drawable/screen_bg"
android:layout_alignParentBottom="false"
android:layout_alignBottom="@id/nav_drawer_btn"
>








-- 
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: Adding a new View causing Force Close

2011-02-09 Thread TreKing
On Wed, Feb 9, 2011 at 11:42 PM, Aaron Buckner  wrote:

> I don't understand how it could be null though
>

Step 1 - step through your debugger to confirm this.


> I basically copied the statements for MyRideScreen and the XML,
>

Copying and pasting leads to many errors.


> so I'm confused as to what I'm doing wrong
>

Your layout, somewhere somehow does not have that view in it.


> If I need to attach more complete code I can do that.
>

How about the XML layout for what you're setting as the content view?

-
TreKing  - Chicago
transit tracking app for Android-powered devices

-- 
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

[android-developers] Re: Adding a new View causing Force Close

2011-02-09 Thread Aaron Buckner
If I comment out the OwnerScreen.setVisibility statement and leave the
findViewById statement there is no force close (of course there is no
call to the OwnerScreen object at that point, I don't understand how
it could be null though, I basically copied the statements for
MyRideScreen and the XML, I even tried pairing back the XML to bare
basics so I'm still a little bit at a loss, I have 2 views that are
built the same way and working so I'm confused as to what I'm doing
wrong, If I need to attach more complete code I can do that.

On Feb 9, 11:01 pm, TreKing  wrote:
> On Wed, Feb 9, 2011 at 9:44 PM, Aaron Buckner  wrote:
> > When adding the OwnerScreen the OwnerScreen.setVisibility(VIS/INVIS);
> > causes a force close
> > where the MyRideScreen setup the same does not
>
> OwnerScreen is null, which means it does not exist in your main
> view hierarchy when you try to find it by ID. Make sure it does.
>
> --- 
> --
> TreKing  - Chicago
> transit tracking app for Android-powered devices

-- 
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