Specifying LinearLayout orientation in resource "values"

by Justin Giles » Tue, 20 Apr 2010 20:41:12 GMT


Sponsored Links
 I suppose you could change the orientation in code.  After you assign the
view in your onCreate, do a check to see whether the user is on landscape or
portrait mode and set the orientation value accordingly.  This should be a
bit more fool-proof than your method, however it could have its own
drawbacks in that it could cause shifting on the screen visible to the user.
 Might be worth a try though.

Justin




>



Specifying LinearLayout orientation in resource "values"

by westmeadboy » Wed, 21 Apr 2010 05:18:35 GMT


 I'm a little nervous about setting it in code (also in
onConfigurationChanged() ) for the reasons you mentioned. It just
feels "tighter" to do it in the XML...




> >


Sponsored Links


Other Threads

1. ddms and kml positioning

I'm trying to use the KML position tool in DDMS and I am not having
any luck.  I have tried it in both the Eclipse DDMS tab and tried
running it from the \tools subdirectory.  I load a .kml file and I see
my point list in the table.  I press play and it seems to be running
through them since the play button resets after about 11 seconds which
I expect.  However, at no time do my points appear in my log
statement, I just keep getting the 37,-122 default value.  If I try a
manual push, nothing appears to be happening either.  Any help is
greatly appreciated.

v/r
--~--~---------~--~----~------------~-------~--~----~

2. Problem debugging the application -MediaPlayer

I am having the same problem but I am only implementing the Activity
Class which is included in the package by default.
THis is the partial code.

public class ActiveOctave extends Activity implements OnErrorListener,
        OnBufferingUpdateListener, OnCompletionListener,
        OnPreparedListener, SurfaceHolder.Callback {

        private static final String TAG = "VideoPlayer";
    private MediaPlayer mp;
    private SurfaceView mPreview;
    private EditText mPath;
    private SurfaceHolder holder;
    private ImageButton mPlay;
    private ImageButton mPause;
    private ImageButton mReset;
    private ImageButton mStop;
    private String current;
    /**
     * Called when the activity is first created.
     */
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        setContentView(R.layout.main);
        // Set up the play/pause/reset/stop buttons
        mPreview = (SurfaceView) findViewById(R.id.surface);
        mPath = (EditText) findViewById(R.id.path);
        mPlay = (ImageButton) findViewById(R.id.play);
        mPause = (ImageButton) findViewById(R.id.pause);
        mReset = (ImageButton) findViewById(R.id.reset);
        mStop = (ImageButton) findViewById(R.id.stop);

This is my Debug Stack.
Thread [<3> main] (Suspended (exception RuntimeException))
        ActivityThread.performLaunchActivity(ActivityThread
$ActivityRecord)
line: 2131
        ActivityThread.handleLaunchActivity(ActivityThread
$ActivityRecord)
line: 2147
        ActivityThread.access$1800(ActivityThread, ActivityThread
$ActivityRecord) line: 112
        ActivityThread$H.handleMessage(Message) line: 1572
        ActivityThread$H(Handler).dispatchMessage(Message) line: 88
        Looper.loop() line: 123
        ActivityThread.main(String[]) line: 3708
        Method.invokeNative(Object, Object[], Class, Class[], Class,
int,
boolean) line: not available [native method]
        Method.invoke(Object, Object...) line: 492
        ZygoteInit$MethodAndArgsCaller.run() line: 734
        ZygoteInit.main(String[]) line: 492
        NativeStart.main(String[]) line: not available [native method]

Please help what to Do.
--~--~---------~--~----~------------~-------~--~----~

3. Should'nt the debugger in Eclipse show results of myEditText.setText("Testing 123");

4. Suppressing unwanted options in image handler

5. Store user data on SD card -- not in on-board memory or on Google's servers

6. Store user data on SD card -- not in on-board memory or on Google's servers

7. Logcat timestamps?