@@ -142,43 +142,25 @@ static boolean hasIntent(Intent intent)
142142 void buildUI ()
143143 {
144144 Context context = activity ;
145-
145+ Intent intent = activity .getIntent ();
146+ final String msg = intent .getStringExtra (EXTRA_ERROR_REPORT_MSG );
147+
148+ //container
146149 LinearLayout layout = new LinearLayout (context );
147150 layout .setOrientation (LinearLayout .VERTICAL );
148151 activity .setContentView (layout );
149152
153+ //header
150154 TextView txtHeader = new TextView (context );
151155 txtHeader .setText ("Callstack" );
152-
153- layout .addView (txtHeader );
154156
155- Intent intent = activity .getIntent ();
156- final String msg = intent .getStringExtra (EXTRA_ERROR_REPORT_MSG );
157-
157+ //error + stacktrace
158158 TextView txtErrorMsg = new TextView (context );
159159 txtErrorMsg .setText (msg );
160160 txtErrorMsg .setHeight (1000 );
161161 txtErrorMsg .setMovementMethod (new ScrollingMovementMethod ());
162162
163- GradientDrawable gd = new GradientDrawable ();
164- gd .setColor (0xFFFFFFFF );
165- gd .setCornerRadius (5 );
166- gd .setStroke (1 , 0xFF000000 );
167- txtErrorMsg .setBackground (gd );
168-
169- layout .addView (txtErrorMsg );
170-
171- Button btnClose = new Button (context );
172- btnClose .setText ("Close" );
173- btnClose .setOnClickListener (new OnClickListener ()
174- {
175- @ Override
176- public void onClick (View v )
177- {
178- activity .finish ();
179- }
180- });
181-
163+ // copy button
182164 Button copyToClipboard = new Button (context );
183165 copyToClipboard .setText ("Copy to clipboard" );
184166 copyToClipboard .setOnClickListener (new OnClickListener ()
@@ -192,9 +174,10 @@ public void onClick(View v)
192174 clipboard .setPrimaryClip (clip );
193175 }
194176 });
195-
177+
178+ layout .addView (txtHeader );
179+ layout .addView (txtErrorMsg );
196180 layout .addView (copyToClipboard );
197- layout .addView (btnClose );
198181 }
199182
200183 private static void createErrorFile (final Context context )
0 commit comments