File tree Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -124,7 +124,23 @@ protected override void OnCreate (Bundle savedInstanceState)
124
124
}
125
125
} ;
126
126
127
- foo . StartDownloading ( FindViewById < Switch > ( Resource . Id . switch1 ) . Checked ) ;
127
+ try {
128
+ foo . StartDownloading ( FindViewById < Switch > ( Resource . Id . switch1 ) . Checked ) ;
129
+ } catch ( Java . Lang . IllegalArgumentException ) {
130
+ foo . File = null ;
131
+ button . Text = "Download crashed." ;
132
+
133
+ try {
134
+ //Open the specific App Info page:
135
+ Intent intent = new Intent ( Android . Provider . Settings . ActionApplicationDetailsSettings ) ;
136
+ intent . SetData ( Android . Net . Uri . Parse ( "package:com.android.providers.downloads" ) ) ;
137
+ StartActivity ( intent ) ;
138
+ } catch ( ActivityNotFoundException ) {
139
+ //Open the generic Apps page:
140
+ Intent intent = new Intent ( Android . Provider . Settings . ActionManageApplicationsSettings ) ;
141
+ StartActivity ( intent ) ;
142
+ }
143
+ }
128
144
} ;
129
145
}
130
146
}
You can’t perform that action at this time.
0 commit comments