TimePicker

by shanmu nathan » Fri, 20 May 2011 12:17:28 GMT


Sponsored Links
 Hi friends,,
            I m new in android developing,  I started  One application using
time Picker. I need one help from yours. I need to show the time picker with
seconds.. i dnt knw how to customize the default time picker... anybody help
me pls..

-- 
With Regards,

SHANMUGANATHAN. A
Software Engineer Trainee,
Citrisys Solution,
Phone: +91.44.22311173
Mail To: sayyadu...@citrisys.com

-- 



Other Threads

1. Scrollview and GestureDetector

I'm making sort of a book app. I have the text displayed as a textview
in a scrollview:

XML:
<ScrollView
          android:id="@+id/chatview"
          android:orientation="vertical"
          android:layout_width="fill_parent"
          android:layout_height="fill_parent">
              <TextView
                  android:id="@+id/webview"
                  android:layout_width="wrap_content"
                  android:layout_height="fill_parent"
                  android:layout_weight="1"
                  android:textSize = "16sp"   />
          </ScrollView>



I then have

Java:
   private GestureDetector gestureScanner;
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        gestureScanner = new GestureDetector(this);
   }


And implemented the required following to catch a left fling or right
fling. And

Java:
   @Override
    public boolean onTouchEvent(MotionEvent me)
    {
     return gestureScanner.onTouchEvent(me);
    }

    public boolean onDown(MotionEvent e)
    {
     return true;
    }

    public boolean onFling(MotionEvent e1, MotionEvent e2, float
velocityX, float velocityY)
    {
     if(velocityX >= 1500){
          nextChapter();
     }
     if(velocityX <= -1500){
                previousChapter();
     }
     return true;
    }

    public void onLongPress(MotionEvent e)
    {
    }

    public boolean onScroll(MotionEvent e1, MotionEvent e2, float
distanceX, float distanceY)
    {
     return true;
    }

    public void onShowPress(MotionEvent e)
    {
    }

    public boolean onSingleTapUp(MotionEvent e)
    {
     return true;
    }


This works fine if the text inside the textview is small (ie. there is
no scroll bar as it all fits within the view). But as soon as the text
requires scrolling, the gesture is no longer picked up by the
detector. onFling is never called.

I have read that it is because scrollview handles its own gestueres?
If so what is the easiest way to maintain the ability to scroll up and
down the text, and also be able to detect flinging left or right and
invoking nextChapter() and previousChapter() respectively?

THanks alot for your time.

Cheers,
SurtaX
--~--~---------~--~----~------------~-------~--~----~

2. ExpandableListView with ResourceCursorAdapter problem

Hi everyone,

I'm trying to get an ExpandableListView with a ResourceCursorAdapter
to work and it's driving me crazy.

The problem: When I let the activity manage the cursors the expanded
state of the tree is not saved between orientation changes nor when I
start an other activity over the top and go back. When I don't let the
activity manage the cursosr it works fine between screen orientation
changes, but it crashes with a "java.lang.IllegalStateException: this
should only be called when the cursor is valid" exception in the
getGroupView() method of CursorTreeAdapter when I start another
activity and return with the back button.

The relevant activity (which extends ExpandableListActivity) code
looks like this:

        @Override
        public void onCreate(final Bundle savedInstanceState) {
                super.onCreate(savedInstanceState);
                dbAdapter = new DbAdapter(this);
                dbAdapter.open();
                final Cursor groupCursor = dbAdapter.findAllGroups();
                startManagingCursor(groupCursor);
                setListAdapter(new MyExpandableListAdapter(this, groupCursor,
R.layout.group_list_item, R.layout.child_list_item));
                registerForContextMenu(getExpandableListView());
        }

and MyExpandableListAdapter just extends ResourceCursorTreeAdapter and
overrides the bindView/Group methods to return the views, and the
getChildrenCursor method as follows:

                @Override
                protected Cursor getChildrenCursor(final Cursor groupCursor) {
                        final long groupId = 
groupCursor.getLong(groupCursor.getColumnIndex
("_id"));
                        final Cursor childCursor = 
dbAdapter.findChildrenForGroup(groupId);
                        startManagingCursor(childCursor);
                        return childCursor;
                }

When I debug to see what happens, I notice that the onSaveInstanceState
() actually saves the proper expanded state of the tree first, but
then my activity deactivates the (managed) cursors in onStop(),
causing the data set of the ExpandableListAdapter to be flagged as
invalid, which causes the expanded list state to be updated (and now
all the group positions are invalid, so all expanded groups are
removed from the list of expanded groups). However, this list is
contained via a reference in the saved state bundle,  so even though
this list is never explicitly added to this bundle again, in the
onRestoreInstanceState() method the list is empty in the bundle
because the reference was modified.

It kind of looks like a bug to me, but maybe I'm just doing stuff all
wrong. Did anybody get this to work properly? Any suggested
workarounds?

Regards,
Sebastiaan

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

3. Question about long pressed

4. Intel Drops an 鈥楢tom` Brand

5. Preference#setSummary does not properly repaint

6. How to set minimum value for SeekBar?

7. Strategies for alerting users about new versions of your app in the appstore?