Skip to content

Instantly share code, notes, and snippets.

@mezdour
Created January 30, 2018 07:46
Show Gist options
  • Save mezdour/ce6115404c9e25cfe613681c6beec7e8 to your computer and use it in GitHub Desktop.
Save mezdour/ce6115404c9e25cfe613681c6beec7e8 to your computer and use it in GitHub Desktop.
Cookies java code
package com.example.android.cookies;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;
public class Cookies extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_cookies);
}
public void eatCookie(View view) {
ImageView beforeCookieImageView = (ImageView) findViewById(R.id.android_cookie_image_view);
//set image
beforeCookieImageView.setImageResource(R.drawable.after_cookie);
TextView statusInitialTextView = (TextView) findViewById(R.id.status_text_view);
statusInitialTextView.setText("I am so full (mohamed mezdour )");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment