This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ParamViewModel( | |
someParameter: Int | |
) : ViewModel() { | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void clearApplicationData() { | |
File cache = getCacheDir(); | |
File appDir = new File(cache.getParent()); | |
if (appDir.exists()) { | |
String[] children = appDir.list(); | |
for (String s : children) { | |
if (!s.equals("lib")) { | |
deleteDir(new File(appDir, s)); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static final String BATTERY_CAPACITY_SYSFS = "/sys/class/power_supply/battery/capacity"; | |
private static String readSysFsFile(String a_File) throws Exception { | |
FileReader a_Reader = new FileReader(a_File); | |
int a_Char; | |
String a_Content = ""; | |
while ((a_Char = a_Reader.read()) != -1) { | |
// Ignore \n | |
if (a_Char != 10) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<!-- Copyright (C) 2008 The Android Open Source Project | |
Licensed under the Apache License, Version 2.0 (the "License"); | |
you may not use this file except in compliance with the License. | |
You may obtain a copy of the License at | |
http://www.apache.org/licenses/LICENSE-2.0 | |
Unless required by applicable law or agreed to in writing, software |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Spinner1 extends Activity { | |
@Override | |
public void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.spinner_1); | |
Spinner s1 = (Spinner) findViewById(R.id.spinner1); | |
CharSequence[] strings = this.getResources().getTextArray(R.array.colors); | |
CustomAdapter<CharSequence> adapter = new CustomAdapter<CharSequence>(this, android.R.layout.simple_spinner_item, strings); |