Unable to remove the prev,next buttons of MediaController, please help me

by Marco Nelissen » Mon, 29 Jun 2009 23:42:58 GMT


Sponsored Links
 


It's not possible for us to try out your code, since you didn't
include the required layouts.


Since you're using your own custom layout, just remove the 'previous'
and 'next' buttons from it. I believe I mentioned this to you several
days ago. Did you try it?

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



Other Threads

1. FW: BroadcastReceiver and Google Services Inquiry

Hi Dianne,

Thank you for quick response.  Given that this is not supported,

What would be the appropriate method to capture  email/sms for non-gmail and
gmail data transactions?

Example mail fields to/from, subject, date, attachments included or not,
etc...
Regards,

kk




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

2. strange behavior on rotating and scaling text

hi, i'm trying to animate text, but strange behavior happened when i
tried to rotate and scale.
When rotating, the text width becoming wider and narrower randomly
When scaling, the text y position is going upper.
i've test with image, but image works perfectly. don't know why text
is not.
Here's my code, please take a look or run it (only one file is enough
to run the demo)
thanks

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

                FrameLayout flContent = new FrameLayout(this);
                flContent.setLayoutParams(new 
LayoutParams(LayoutParams.FILL_PARENT,
                                LayoutParams.FILL_PARENT));
                setContentView(flContent);

                SurfaceView svPreviewer = new SurfaceDrawer(this);
                svPreviewer.setLayoutParams(new LayoutParams
(LayoutParams.FILL_PARENT,
                                LayoutParams.FILL_PARENT));

                flContent.addView(svPreviewer);
        }

        private class SurfaceDrawer extends SurfaceView implements
                        SurfaceHolder.Callback, Runnable {

                private SurfaceHolder mSurfaceHolder;
                private int mLayoutWidth;
                private int mLayoutHeight;

                private String mText = "Hello World! Hello Android!";
                private Paint mFontPaint = new Paint();
                private Paint mBackgroundPaint = new Paint();
                private Rect mBackgroundRect = new Rect();

                // thread
                private Thread mThread;
                private boolean mIsStopped = false;
                private boolean mIsRunningMode = false;
                private Lock mLock = new ReentrantLock();
                private Condition mCond = mLock.newCondition();

                public SurfaceDrawer(Context context) {
                        super(context);
                        mSurfaceHolder = getHolder();
                        mSurfaceHolder.addCallback(this);

                        mFontPaint.setColor(Color.WHITE);
                        mBackgroundPaint.setColor(Color.MAGENTA);

                        // set the rect for background
                        mFontPaint.getTextBounds(mText, 0, mText.length(),
mBackgroundRect);

                        mThread = new Thread(this);
                        mThread.start();
                }

                public void surfaceChanged(SurfaceHolder holder, int format, int
width,
                                int height) {
                        mLayoutWidth = width;
                        mLayoutHeight = height;

                        mLock.lock();
                        mIsRunningMode = true;
                        mCond.signal();
                        mLock.unlock();
                }

                public void surfaceCreated(SurfaceHolder holder) {
                }

                public void surfaceDestroyed(SurfaceHolder holder) {
                        mLock.lock();
                        mIsStopped = true;
                        mIsRunningMode = false;
                        mCond.signal();
                        mLock.unlock();

                        try {
                                mThread.join();
                        } catch (Exception e) {

                        }
                }

                public void run() {
                        while (mIsStopped == false) {
                                mLock.lock();

                                try {
                                        while (mIsRunningMode == false) {
                                                mCond.await();
                                        }
                                        if (mIsStopped == true) {
                                                mLock.unlock();
                                                break;
                                        }

                                        DrawRotationAnimation();
                                        DrawScalingAnimation();

                                } catch (InterruptedException e) {
                                        e.printStackTrace();
                                }

                                mLock.unlock();
                        }
                }

                public void DrawRotationAnimation() {
                        Canvas c;
                        int centerX = mLayoutWidth / 2;
                        int centerY = mLayoutHeight / 2;
                        for (int i = 0; i < 360; i += 20) {
                                c = mSurfaceHolder.lockCanvas();
                                c.save();

                                c.rotate(i, centerX, centerY);
                                c.translate(centerX - (mBackgroundRect.width() 
/ 2), centerY
                                                - (mBackgroundRect.height() / 
2));

                                c.drawColor(Color.BLACK);
                                c.drawRect(mBackgroundRect, mBackgroundPaint);
                                c.drawText(mText, 0, 0, mFontPaint);

                                c.restore();
                                mSurfaceHolder.unlockCanvasAndPost(c);
                                SystemClock.sleep(300);
                        }
                }

                public void DrawScalingAnimation() {
                        Canvas c;
                        int centerX = mLayoutWidth / 2;
                        int centerY = mLayoutHeight / 2;
                        for (float scale = 1; scale < 3; scale += 0.2) {
                                c = mSurfaceHolder.lockCanvas();
                                c.save();

                                c.scale(scale, scale, centerX, centerY);
                                c.translate(centerX - (mBackgroundRect.width() 
/ 2), centerY
                                                - (mBackgroundRect.height() / 
2));

                                c.drawColor(Color.BLACK);
                                c.drawRect(mBackgroundRect, mBackgroundPaint);
                                c.drawText(mText, 0, 0, mFontPaint);

                                c.restore();
                                mSurfaceHolder.unlockCanvasAndPost(c);
                                SystemClock.sleep(300);
                        }
                }

        }
}

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

3. strange behavior on rotating and scaling text

4. MediaController is not working properly with MediaPlayer

5. How to import data from Excel (or any other source text, world etc) to SQLlite

6. A simple application which sends location to server.

7. start and stop BOOT_COMPLETED in broadcast receiver