Android – Facebook SDK 3 – How to login programmatically without LoginButton

Is what you posted your entire Activity? You also need to override onActivityResult, and pass the values to Session.getActiveSession().onActivityResult(…). Otherwise, the Session won’t know that the user has authorized your app, and that’s why you see the error (Session thinks that there’s still a pending auth request, which is why you can’t reauthorize for publish).

Make ScaleTransform start from Center instead of Top-Left Corner

You can set RenderTransformOrigin to “0.5, 0.5″ <Style x:Key=”sizeButton” TargetType=”Button”> <Setter Property=”RenderTransformOrigin” Value=”0.5, 0.5″/> <Style.Triggers> <Trigger Property=”IsMouseOver” Value=”True”> <Setter Property=”RenderTransform”> <Setter.Value> <ScaleTransform ScaleX=”1.5″ ScaleY=”1.5″/> </Setter.Value> </Setter> </Trigger> </Style.Triggers> </Style>

Android: Switch camera when button clicked

Button otherCamera = (Button) findViewById(R.id.OtherCamera); otherCamera.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { if (inPreview) { camera.stopPreview(); } //NB: if you don’t release the current camera before switching, you app will crash camera.release(); //swap the id of the camera to be used if(currentCameraId == Camera.CameraInfo.CAMERA_FACING_BACK){ currentCameraId = Camera.CameraInfo.CAMERA_FACING_FRONT; } else { currentCameraId = Camera.CameraInfo.CAMERA_FACING_BACK; … Read more

Making a that’s a link in HTML

<a href=”#”><button>Link Text</button></a> You asked for a link that looks like a button, so use a link and a button 🙂 This will preserve default browser button styling. The button by itself does nothing, but clicking it activates its parent link. Demo: <a href=”http://stackoverflow.com”><button>Link Text</button></a>

How to create button in Action bar in android [duplicate]

In your activity class, override the following methods if they are not there by default: // create an action bar button @Override public boolean onCreateOptionsMenu(Menu menu) { // R.menu.mymenu is a reference to an xml file named mymenu.xml which should be inside your res/menu directory. // If you don’t have res/menu, just create a directory … Read more

Android, setting background color of button loses ripple effect

You can add the ripple effect & background color with an additionnal ripple drawable: your layout : <?xml version=”1.0″ encoding=”utf-8″?> <LinearLayout xmlns:android=”http://schemas.android.com/apk/res/android” android:orientation=”vertical” android:layout_width=”match_parent” android:layout_height=”match_parent”> <Button android:id=”@+id/button_connect” android:layout_width=”fill_parent” android:layout_height=”wrap_content” android:layout_marginTop=”20dip” android:fontFamily=”sans-serif” android:text=”Connect” android:background=”@drawable/ripple” android:textColor=”#FFFFFF” android:textSize=”18sp” /> </LinearLayout> ripple.xml (this is where you can add background color in addition to the ripple effect) : <?xml version=”1.0″ … Read more