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
→ bluesm joined (uid13438@gateway/web/irccloud.com/x-vwzagpplvfbnrrfz) | |
17:06:39 Channel mode is +Ccgnt | |
17:06:48 ⇐ eulerphi quit ([email protected]) Ping timeout: 252 seconds | |
17:06:55 <bluesm> I know my question could be vague but I will ask anyway. | |
17:07:17 <bluesm> Does the "Switch" from enumerable value, will compare and then "jump" or just jump ? It would be not to compare... but just make array with pointers to jump [firstpointer, second pointer, third pointer] and value "0" would select "first pointer" and jump to the first pointer ? | |
17:07:39 ⇐ haxxpop quit ([email protected]) Quit: Konversation terminated! | |
17:07:45 <bluesm> Normal switch compares the given value, with other values... But if you have say "3" states. - 0 1 2 - . i could instead of comparing, it could go array of pointers get "n'th" (0 , 1 , 2 in our case) value in this array. And execute something at give pointer. | |
17:08:46 <bluesm> I know it could depend on the higher programm |
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
package pl.twigit.timertry; | |
import android.os.Handler; | |
import android.support.v7.app.ActionBarActivity; | |
import android.support.v7.app.ActionBar; | |
import android.support.v4.app.Fragment; | |
import android.os.Bundle; | |
import android.util.Log; | |
import android.view.LayoutInflater; | |
import android.view.Menu; |
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 IdentifyMyParts { | |
public static int x = 7; | |
public int y = 3; | |
} |
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
private int getIntFromEditText (EditText et) throws Exception { | |
try { | |
return Integer.parseInt(et.getText().toString()); | |
} catch (Exception e) { | |
throw new Exception(); | |
} | |
} |
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
private int getIntFromEditText (EditText et) throws Exception { | |
try { | |
return Integer.parseInt(et.getText().toString()); | |
} catch (NumberFormatException e) { | |
throw e; // because NumberFormatException describe my problem exactly | |
} catch (Exception e) { | |
throw e; // every other exception | |
} | |
} |
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
private int getIntFromEditText (EditText et) throws NumberFormatException { | |
return Integer.parseInt(et.getText().toString()); | |
} |
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
private int myMethod () { | |
try { | |
someCodeThatCouldThrowException (); | |
} catch (someCodeThatCouldThrowException's_Exception e) { // pseudocode | |
throw new myCustomDesigned | |
} | |
} |
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
private int myMethod () { | |
try { | |
someCodeThatCouldThrowException (); | |
} catch (someCodeThatCouldThrowException's_Exception e) { // pseudocode | |
throw new myCustomDesignedExceptionForMyMethod(); | |
} | |
} |
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
private int myMethod () { | |
try { | |
someCodeThatCouldThrowException (); | |
} catch (someCodeThatCouldThrowException's_Exception e) { // pseudocode | |
throw new myCustomDesignedExceptionForMyMethod(); | |
} | |
} |
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 View getView(int i, View view, ViewGroup viewGroup) { | |
Log.v(MainActivity.TAG, "getView executed"); | |
LayoutInflater layoutInflater = (LayoutInflater)MainActivity.this.getSystemService(Context.LAYOUT_INFLATER_SERVICE); | |
View taskRoot = layoutInflater.inflate(R.layout.one_task, null); | |
((TextView) taskRoot.findViewById(R.id.seconds_edit_text)).setText("00"); | |
((TextView) taskRoot.findViewById(R.id.minutes_edit_text)).setText("00"); | |
((TextView) taskRoot.findViewById(R.id.hours_edit_text)).setText("00"); | |
return taskRoot; |