File tree 1 file changed +7
-3
lines changed
app/src/main/java/com/github/mobile/ui/repo
1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change 26
26
import static com .github .mobile .util .TypefaceUtils .ICON_NEWS ;
27
27
import android .content .Intent ;
28
28
import android .os .Bundle ;
29
+ import android .text .TextUtils ;
29
30
import android .widget .ProgressBar ;
30
31
31
32
import com .actionbarsherlock .app .ActionBar ;
@@ -174,7 +175,7 @@ public boolean onOptionsItemSelected(MenuItem item) {
174
175
starRepository ();
175
176
return true ;
176
177
case id .m_share :
177
- shareRepositoryURL ();
178
+ shareRepository ();
178
179
return true ;
179
180
case android .R .id .home :
180
181
finish ();
@@ -275,9 +276,12 @@ protected void onSuccess(Boolean watching) throws Exception {
275
276
}.execute ();
276
277
}
277
278
278
- private void shareRepositoryURL () {
279
+ private void shareRepository () {
280
+ String repoUrl = repository .getHtmlUrl ();
281
+ if (TextUtils .isEmpty (repoUrl ))
282
+ repoUrl = "https://github.com/" + repository .generateId ();
279
283
Intent sharingIntent = ShareUtils .create (repository .generateId (),
280
- repository . getHtmlUrl () );
284
+ repoUrl );
281
285
startActivity (sharingIntent );
282
286
}
283
287
}
You can’t perform that action at this time.
0 commit comments