Showing posts with label problem. Show all posts
Showing posts with label problem. Show all posts

Saturday, September 19, 2015

Required XML attribute “adSize” was missing

<com.google.android.gms.ads.AdView
    xmlns:ads="http://schemas.android.com/apk/res-auto"
    android:id="@+id/adView"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    ads:adUnitId="YOUR_AD_UNIT_ID"
    ads:adSize="BANNER"/>
basically, add this line in the ads xml
xmlns:ads="http://schemas.android.com/apk/res-auto"

Tuesday, September 15, 2015

SharedPrefences Problem

SharedPreferences cannot be called from outside onCreate()
public class MainActivity extends Activity implements
        SoundPool.OnLoadCompleteListener,
        View.OnClickListener,
        GoogleApiClient.ConnectionCallbacks,
        GoogleApiClient.OnConnectionFailedListener
{

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(layout.activity_main);


        SharedPreferences loginState =getSharedPreferences("loginState", Context.MODE_PRIVATE);
        SharedPreferences.Editor editor = loginState.edit();

..
..
} //END ONCREATE


    @Override
    public void onConnected(Bundle connectionHint) {
        // The player is signed in. Hide the sign-in button and allow the
        // player to proceed.

HERE WE WANT TO COMMIT

    } 
} // END MAIN ACTIVITY