Change theme
Help
Press space for more information.
Show links for this issue (Shortcut: i, l)
Copy issue ID
Previous Issue (Shortcut: k)
Next Issue (Shortcut: j)
Sign in to use full features.
Vote: I am impacted
Notification menu
Refresh (Shortcut: Shift+r)
Go home (Shortcut: u)
Use Markdown for this comment
Set severity, which reflects how much the issue affects the use of the product
Change issue status back to 'Assigned'
Pending code changes (auto-populated)
[ID: 84651]
[ID: 85206]
Set the version(s) of the product affected by this issue (comma-separated list)
Set the version(s) of the product in which the issue should be fixed (comma-separated list)
Set the version(s) of the product in which the issue fix was verified (comma-separated list)
Set if this issue occurs in production
Set Reporter
Set Type
Set priority, which reflects how soon the issue should be fixed
Set Status
Set Assignee
Set Verifier
Remove item
View or edit staffing
View issue level access limits(Press Alt + Right arrow for more information)
Description
#1Here's the stack trace:
-----------------------------------------------------------------------
08-17 02:23:29.505: ERROR/AndroidRuntime(221): Uncaught handler: thread main exiting due to uncaught exception
08-17 02:23:29.515: ERROR/AndroidRuntime(221): java.lang.ArithmeticException: divide by zero
08-17 02:23:29.515: ERROR/AndroidRuntime(221): at android.widget.TableLayout.mutateColumnsWidth(TableLayout.java:576)
08-17 02:23:29.515: ERROR/AndroidRuntime(221): at android.widget.TableLayout.shrinkAndStretchColumns(TableLayout.java:565)
08-17 02:23:29.515: ERROR/AndroidRuntime(221): at android.widget.TableLayout.measureVertical(TableLayout.java:463)
08-17 02:23:29.515: ERROR/AndroidRuntime(221): at android.widget.TableLayout.onMeasure(TableLayout.java:428)
08-17 02:23:29.515: ERROR/AndroidRuntime(221): at android.view.View.measure(View.java:7964)
08-17 02:23:29.515: ERROR/AndroidRuntime(221): at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:3023)
08-17 02:23:29.515: ERROR/AndroidRuntime(221): at android.widget.FrameLayout.onMeasure(FrameLayout.java:245)
08-17 02:23:29.515: ERROR/AndroidRuntime(221): at android.view.View.measure(View.java:7964)
08-17 02:23:29.515: ERROR/AndroidRuntime(221): at android.widget.LinearLayout.measureVertical(LinearLayout.java:464)
08-17 02:23:29.515: ERROR/AndroidRuntime(221): at android.widget.LinearLayout.onMeasure(LinearLayout.java:278)
08-17 02:23:29.515: ERROR/AndroidRuntime(221): at android.view.View.measure(View.java:7964)
08-17 02:23:29.515: ERROR/AndroidRuntime(221): at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:3023)
08-17 02:23:29.515: ERROR/AndroidRuntime(221): at android.widget.FrameLayout.onMeasure(FrameLayout.java:245)
08-17 02:23:29.515: ERROR/AndroidRuntime(221): at android.view.View.measure(View.java:7964)
08-17 02:23:29.515: ERROR/AndroidRuntime(221): at android.view.ViewRoot.performTraversals(ViewRoot.java:763)
08-17 02:23:29.515: ERROR/AndroidRuntime(221): at android.view.ViewRoot.handleMessage(ViewRoot.java:1633)
08-17 02:23:29.515: ERROR/AndroidRuntime(221): at android.os.Handler.dispatchMessage(Handler.java:99)
08-17 02:23:29.515: ERROR/AndroidRuntime(221): at android.os.Looper.loop(Looper.java:123)
08-17 02:23:29.515: ERROR/AndroidRuntime(221): at android.app.ActivityThread.main(ActivityThread.java:4363)
08-17 02:23:29.515: ERROR/AndroidRuntime(221): at java.lang.reflect.Method.invokeNative(Native Method)
08-17 02:23:29.515: ERROR/AndroidRuntime(221): at java.lang.reflect.Method.invoke(Method.java:521)
08-17 02:23:29.515: ERROR/AndroidRuntime(221): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)
08-17 02:23:29.515: ERROR/AndroidRuntime(221): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
08-17 02:23:29.515: ERROR/AndroidRuntime(221): at dalvik.system.NativeStart.main(Native Method)
-----------------------------------------------------------------------
And here's mycode:
-----------------------------------------------------------------------
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
//--- Retrieve the extra data that should've been sent with the intent
Bundle extras = getIntent().getExtras();
String bracketName = extras.getString("BracketName");
Integer numTeams = Integer.parseInt(extras.getString("NumTeams"));
String tournamentType = extras.getString("TournamentType");
String opponentAssignment = extras.getString("OpponentAssignment");
//--- If we didn't get the data, go back to the previous activity
if ((bracketName == null) || (numTeams == null) || (tournamentType == null) || (opponentAssignment == null)) {
Intent intent = new Intent(NewBracketActivity2.this, NewBracketActivity1.class);
startActivity(intent);
}
//--- Table layout
TableLayout layout = new TableLayout(this);
layout.setLayoutParams(new TableLayout.LayoutParams(TableLayout.LayoutParams.FILL_PARENT, TableLayout.LayoutParams.FILL_PARENT));
layout.setStretchAllColumns(true);
for (Integer i = 1; i <= numTeams; i++) {
//--- Table row
TableRow tableRow = new TableRow(this);
TableLayout.LayoutParams trParams = new TableLayout.LayoutParams(TableLayout.LayoutParams.FILL_PARENT, TableLayout.LayoutParams.WRAP_CONTENT);
tableRow.setBaselineAligned(false);
trParams.setMargins(0, 10, 0, 0);
tableRow.setLayoutParams(trParams);
//--- Text view (team number)
TextView textView = new TextView(this, null, android.R.style.TextAppearance_Medium);
TableLayout.LayoutParams tvParams = new TableLayout.LayoutParams(TableLayout.LayoutParams.WRAP_CONTENT, TableLayout.LayoutParams.FILL_PARENT);
Integer textViewID = i + 100;
textView.setText("Team " + i);
textView.setId(textViewID);
tvParams.setMargins(0, 0, 5, 0);
textView.setGravity(Gravity.CENTER);
textView.setLayoutParams(tvParams);
tableRow.addView(textView);
//--- Edit text (team name)
EditText editText = new EditText(this);
RelativeLayout.LayoutParams etParams = new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.FILL_PARENT, RelativeLayout.LayoutParams.WRAP_CONTENT);
etParams.addRule(RelativeLayout.RIGHT_OF, textViewID);
editText.setLayoutParams(etParams);
tableRow.addView(editText);
layout.addView(tableRow);
}
setContentView(layout);
}
-----------------------------------------------------------------------