This file contains hidden or 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
public class BaseActivity extends AppCompatActivity { | |
// Constant Variable Declarations | |
private static final String MUTE_STATUS = "MUTE_STATUS"; | |
private static final String TAG = "BaseActivity"; | |
// Variable Declarations | |
private AudioManager mAudioManager; | |
private TelephonyManager mTelephonyManager; | |
protected SharedPreferences mSharedPrefs; | |
protected boolean muteSound; | |
// UI Declarations |
This file contains hidden or 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
public class BaseActivity extends AppCompatActivity { | |
// Constant Variable Declarations | |
private static final String MUTE_STATUS = "MUTE_STATUS"; | |
private static final String TAG = "mute"; | |
// Variable Declarations | |
private AudioManager mAudioManager; | |
private TelephonyManager mTelephonyManager; | |
protected SharedPreferences mSharedPrefs; | |
protected boolean muteSound; | |
// UI Declarations |
This file contains hidden or 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
class InstanceofDemo { | |
public static void main(String[] args) { | |
Parent obj1 = new Parent(); | |
Parent obj2 = new Child(); | |
System.out.println("obj1 instanceof Parent: " | |
+ (obj1 instanceof Parent)); | |
System.out.println("obj1 instanceof Child: " | |
+ (obj1 instanceof Child)); |
This file contains hidden or 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
public class BaseActivity extends AppCompatActivity { | |
// Variable Declarations | |
private AudioManager mAudioManager; | |
private TelephonyManager mTelephonyManager; | |
private static final String = "MUTE_STATUS"; | |
protected SharedPreferences mSharedPrefs; | |
protected boolean muteSound; | |
final String TAG = "mute"; | |
// UI Declarations | |
private MenuItem mMuteMenuItem; |
This file contains hidden or 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
@Override | |
public boolean onOptionsItemSelected(MenuItem item) { | |
switch (item.getItemId()) { | |
case R.id.muteMenu: | |
changeMuteStatus | |
break; | |
} | |
return super.onOptionsItemSelected(item); | |
} |
This file contains hidden or 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
public class BaseActivity extends AppCompatActivity { | |
private AudioManager mAudioManager; | |
private TelephonyManager mTelephonyManager; | |
private boolean muteSound; | |
final String TAG = "mute"; | |
private PhoneStateListener phoneStateListener = new PhoneStateListener() { | |
@Override | |
public void onCallStateChanged(int state, String incomingNumber) { | |
if (state == TelephonyManager.CALL_STATE_RINGING) { //Incoming call: Pause music | |
Toast.makeText(BaseActivity.this, "INCOMING CALL", Toast.LENGTH_SHORT).show(); |
This file contains hidden or 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
public class BaseActivity extends AppCompatActivity { | |
private AudioManager mAudioManager; | |
private TelephonyManager mTelephonyManager; | |
private boolean muteSound; | |
final String TAG = "mute"; | |
private PhoneStateListener phoneStateListener = new PhoneStateListener() { | |
@Override | |
public void onCallStateChanged(int state, String incomingNumber) { | |
if (state == TelephonyManager.CALL_STATE_RINGING) { | |
Log.v(TAG, "INCOMING CALL"); |