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
source ~/git-completion.bash |
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
public class UsersJDBCDao { | |
private static final String GET_ALL_USERS = "SELECT * FROM users"; | |
public UsersResultSet getAllUsers() { | |
Connection conn = null; | |
PreparedStatement ps = null; | |
ResultSet rs = null; | |
try { | |
conn = getConnection(); |
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
public class UsersResultSet { | |
private ResultSet _rs; | |
private PreparedStatement _ps; | |
private Connection _conn; | |
public UsersResultSet(ResultSet rs, PreparedStatement ps, Connection conn) { | |
_rs = rs; | |
_ps = ps; | |
_conn = conn; | |
} |
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
public class TabTutorialActivity extends TabActivity { | |
// Divide 1.0 by # of tabs needed | |
// In this case: 1.0/2 => 0.5 | |
private static final LayoutParams params = new LinearLayout.LayoutParams( | |
LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT, 0.5f); | |
private static TabHost tabHost; | |
private static TabHost.TabSpec spec; | |
private static Intent intent; |
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
<?xml version="1.0" encoding="utf-8"?> | |
<TabHost xmlns:android="http://schemas.android.com/apk/res/android" | |
android:id="@android:id/tabhost" | |
android:layout_width="fill_parent" | |
android:layout_height="fill_parent" > | |
<LinearLayout | |
android:id="@+id/tabcontainer" | |
android:layout_width="fill_parent" | |
android:layout_height="fill_parent" |
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
<?xml version="1.0" encoding="utf-8"?> | |
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
android:id="@+id/tab" | |
android:layout_width="wrap_content" | |
android:layout_height="48dp" | |
android:layout_gravity="left" | |
android:orientation="vertical" > | |
<TextView | |
android:id="@+id/tabLabel" |
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
public class TabContentActivity extends Activity { | |
@Override | |
public void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
TextView textview = new TextView(this); | |
// Get data passed in from the tab for display | |
textview.setText(getIntent().getStringExtra("content")); | |
setContentView(textview); |
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
// Divide 1.0 by # of tabs needed | |
// In this case: 1.0/2 => 0.5 | |
private static final LayoutParams params = new LinearLayout.LayoutParams( | |
LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT, 0.5f); | |
private static TabHost tabHost; | |
private static TabHost.TabSpec spec; | |
private static Intent intent; | |
private static LayoutInflater inflater; |
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
public class TabTutorialActivity extends TabActivity { | |
@Override | |
public void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.main); | |
} | |
} |
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
// Get inflator so we can start creating the custom view for tab | |
inflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE); | |
// Get tab manager | |
tabHost = getTabHost(); |