File tree Expand file tree Collapse file tree 2 files changed +15
-0
lines changed
android/modules/app/src/java/ti/modules/titanium/app
apidoc/Titanium/App/Android Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Original file line number Diff line number Diff line change 66 */
77package ti .modules .titanium .app ;
88
9+ import static android .content .Context .ACTIVITY_SERVICE ;
10+
911import org .appcelerator .kroll .KrollModule ;
1012import org .appcelerator .kroll .KrollRuntime ;
1113import org .appcelerator .kroll .annotations .Kroll ;
1719import org .appcelerator .titanium .proxy .RProxy ;
1820
1921import android .app .Activity ;
22+ import android .app .ActivityManager ;
2023import android .content .Intent ;
2124import android .content .pm .PackageInfo ;
2225import android .content .pm .PackageManager .NameNotFoundException ;
@@ -61,6 +64,13 @@ public ActivityProxy getTopActivity()
6164 }
6265 }
6366
67+ @ Kroll .method
68+ public Boolean clearUserCache ()
69+ {
70+ return ((ActivityManager ) TiApplication .getInstance ()
71+ .getSystemService (ACTIVITY_SERVICE )).clearApplicationUserData ();
72+ }
73+
6474 @ Kroll .getProperty
6575 public int getAppVersionCode ()
6676 {
Original file line number Diff line number Diff line change @@ -64,6 +64,11 @@ properties:
6464 permission : read-only
6565 since : 3.3.0
6666
67+ methods :
68+ - name : clearUserCache
69+ summary : Clears app data and cache. This will close the app.
70+ since : 13.1.0
71+
6772events :
6873 - name : shortcutitemclick
6974 summary : Fired when a <Titanium.UI.ShortcutItem> is clicked.
You can’t perform that action at this time.
0 commit comments