9 Replies - 7259 Views - Last Post: 05 July 2010 - 07:48 PM

#1 cmh0114  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 10
  • View blog
  • Posts: 143
  • Joined: 03-January 10

Change Android Title

Posted 29 June 2010 - 09:28 AM

When designing an Android app, how do you change the text that displays below the app on the homepage? I'd assume this is the app title, but I can't find any fields that refer to a title.
Is This A Good Question/Topic? 0
  • +

Replies To: Change Android Title

#2 Guest_vik09*


Reputation:

Re: Change Android Title

Posted 29 June 2010 - 01:09 PM

If I understood you correctly that changing the app_name in the strings.xml resources will do the trick.
Was This Post Helpful? 0

#3 KaffineAddict  Icon User is offline

  • New D.I.C Head
  • member icon

Reputation: 3
  • View blog
  • Posts: 24
  • Joined: 23-October 09

Re: Change Android Title

Posted 29 June 2010 - 04:21 PM

there is also a method
setTitle(char sequence)


This is a standard method of the main activity
Was This Post Helpful? 1
  • +
  • -

#4 cmh0114  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 10
  • View blog
  • Posts: 143
  • Joined: 03-January 10

Re: Change Android Title

Posted 01 July 2010 - 09:46 AM

Modifying the XML file didn't work, but the setTitle method worked. Thanks!
Another question - how do I modify the view from a class besides the main Activity class? When I try calling Activity.setContentView(R.layout.someView), it tells me that I cannot call a non-static method from a static context.
Was This Post Helpful? 0
  • +
  • -

#5 macosxnerd101  Icon User is online

  • Self-Trained Economist
  • member icon




Reputation: 10560
  • View blog
  • Posts: 39,071
  • Joined: 27-December 08

Re: Change Android Title

Posted 02 July 2010 - 09:20 PM

The setContentView() method isn't static, so you have to invoke it from an Activity object. As for changing the view, you can do so programatically (more like with Swing and AWT) or by using the setContentView() method to change which XML document is being parsed to define the layout.
Was This Post Helpful? 0
  • +
  • -

#6 cmh0114  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 10
  • View blog
  • Posts: 143
  • Joined: 03-January 10

Re: Change Android Title

Posted 03 July 2010 - 09:52 PM

How would you change the view programatically? Is there an Android library similar to the standard Java Graphics2D library?
Was This Post Helpful? 0
  • +
  • -

#7 macosxnerd101  Icon User is online

  • Self-Trained Economist
  • member icon




Reputation: 10560
  • View blog
  • Posts: 39,071
  • Joined: 27-December 08

Re: Change Android Title

Posted 04 July 2010 - 08:41 AM

gabehabe has a very nice tutorial on dynamic layouts, which I found very helpful a couple days ago. You'll find it fairly similar to Swing and AWT.

As for the animation, you'll want to look at the android.view.animation package. After glancing through this package, it seems very different than the standard methods of painting and animating in Swing and AWT.
Was This Post Helpful? 0
  • +
  • -

#8 cmh0114  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 10
  • View blog
  • Posts: 143
  • Joined: 03-January 10

Re: Change Android Title

Posted 05 July 2010 - 06:37 AM

Not quite what I was looking for, but that looks very helpful. Thanks. :)

I was more asking if the Android has a method like the following (which is in the Java Graphics2D library):

g.drawImage(x, y, width, height);

I've used that method many times in my Java programs, and I'm familiar with how it works. Are there any methods in the Android libraries that allow you to specify the coordinates you want to draw at?
Was This Post Helpful? 0
  • +
  • -

#9 macosxnerd101  Icon User is online

  • Self-Trained Economist
  • member icon




Reputation: 10560
  • View blog
  • Posts: 39,071
  • Joined: 27-December 08

Re: Change Android Title

Posted 05 July 2010 - 02:33 PM

Take a look at ImageView. I'm not sure how to specify the exact (x,y) coordinates, but you can use the Layout to position it.
Was This Post Helpful? 0
  • +
  • -

#10 cmh0114  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 10
  • View blog
  • Posts: 143
  • Joined: 03-January 10

Re: Change Android Title

Posted 05 July 2010 - 07:48 PM

I'm not sure that using a Layout would work for this - I need to create an environment where things are constantly moving across the screen. There's probably a way to do it with a bunch of different types of layouts, but I thought it would be a much simpler program if I could calculate the x and y coordinates, and then specifically tell the program to draw at those coordinates.

By the way, thanks for all of your help. I'm learning a lot, and I really appreciate it. :)
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1