is Invalidate() causes taking more time ?

by manoj » Sat, 05 Sep 2009 17:55:20 GMT


Sponsored Links
 Hi friends,

I am trying an app (just like a karaoke) which has some predefined set
of lines on the canvas.

After some time I will redraw the strings of each line on the canvas
with another color using Timer.schedule() function.

But the redrawn strings are painted more time than the given time in
schedule () ( just my guess).

I am using postInvalidate() function in my app.

How can I sync lyrics with exact timings?

Thanks,
Manoj.

--~--~---------~--~----~------------~-------~--~----~



Other Threads

1. ImageView findViewById returns null?

Hi, everyone:

I've run into a very strange problem with some code I'm working on.
First, here's my layout:


<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
android:id="@+id/widget28"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
xmlns:android="http://schemas.android.com/apk/res/android"
<TextView
android:id="@+id/friendName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_alignParentLeft="true"
android:layout_margin="2px" android:text="Insert Name Here"
android:textSize="10sp">
</TextView>
<TextView
android:id="@+id/timeStamp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="TextView"
android:layout_alignParentTop="true"
android:layout_toRightOf="@id/friendName"
android:layout_margin="2px" android:textSize="10sp">
</TextView>
<ImageView
android:id="@+id/icon"
android:layout_width="48px"
android:layout_height="48px"
android:layout_below="@+id/friendName"
android:layout_alignParentLeft="true"
android:src="@drawable/icon" android:layout_margin="2px">
</ImageView>
<TextView
android:id="@+id/myText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="TextView"
android:layout_alignTop="@+id/widget31"
android:layout_toRightOf="@id/widget31"
android:layout_margin="2px" android:textSize="12sp">
</TextView>
</RelativeLayout>


I'm trying to change data and images in my layout. First, when I try:

TextView friendNameView = (TextView) view.findViewById
(R.id.friendName);

It works great. It returns a TextView object and I can manipulate it
as expected. However, when I try:

ImageView iconView = (ImageView) view.findViewById(R.id.icon);

It always returns a null value. I thought I might have a wrong
resource id, but I've double checked it and it appears correct. Any
ideas why I can't seem to grab this object, or if there's anything
else I need to double check? Thanks!

Mark
--~--~---------~--~----~------------~-------~--~----~

2. How can I create a custom composite widget in android

Hi,

I have read the LabelView example in APIDemo which show how to create
a custom widget.

However, what if I want to create a custom widget which is a composite
of existing android widget?

For example, in my currently activity, I have this in my layout xml
file which has 2 bottoms left, right aligned:

<RelativeLayout
                        android:id="@+id/arow"
                        android:gravity="left"
                        android:layout_width="fill_parent"
                        android:layout_height="50px"
                        android:orientation="horizontal"
                        android:background="#000000"
                        android:layout_alignParentTop="true">

<ImageView
                                android:id="@+id/left"
                                android:layout_width="wrap_content"
                                android:layout_height="wrap_content"
                                android:layout_alignParentLeft="true"
                                android:layout_centerVertical="true"
                                android:src="@drawable/left"
                                />
        
                        <ImageView
                                android:id="@+id/right"
                                android:layout_width="wrap_content"
                                android:layout_height="wrap_content"
                                android:layout_alignParentRight="true"
                                android:layout_centerVertical="true"
                                android:src="@drawable/right"
                        />

</RelativeLayout>

My question is how can i create a custom widget which is a  composite
widget of 2 ImageView , with left, right aligned?

I know my custom widget need to be inherited from view, but if i do
that, I can't do 'setContentView()' in my custom widget class (since
that is an Activity method).

so how can I apply the above xml to my custom widget class?

Thank you.

--~--~---------~--~----~------------~-------~--~----~

3. Loading animation throbber?

4. toolchain 4.3.1-eabi-armv6

5. what type of functioanlities will be written in onStart method

6. Will ADP1 support payed apps from the store

7. Where can i see the Android applications and its price