Created
January 30, 2018 07:46
-
-
Save mezdour/ce6115404c9e25cfe613681c6beec7e8 to your computer and use it in GitHub Desktop.
Cookies java code
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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