Instantly share code, notes, and snippets.

View MainActivity.kt
class MainActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
Log.d("TEST", "onCreate: $this")
setContentView(R.layout.activity_main)
findViewById<View>(R.id.test).setOnClickListener { test() }
}
override fun onStart() {
View MainActivity.java
package com.ogaclejapan.myapplication;
import com.ogaclejapan.smarttablayout.SmartTabLayout;
import com.ogaclejapan.smarttablayout.utils.v4.FragmentPagerItem;
import com.ogaclejapan.smarttablayout.utils.v4.FragmentPagerItemAdapter;
import com.ogaclejapan.smarttablayout.utils.v4.FragmentPagerItems;
import android.os.Bundle;
import android.support.v4.view.ViewPager;
import android.support.v7.app.ActionBarActivity;
View MainActivity.java
package com.ogaclejapan.myapplication;
import com.ogaclejapan.smarttablayout.SmartTabLayout;
import com.ogaclejapan.smarttablayout.utils.ViewPagerItem;
import com.ogaclejapan.smarttablayout.utils.ViewPagerItemAdapter;
import com.ogaclejapan.smarttablayout.utils.ViewPagerItems;
import android.app.Activity;
import android.os.Bundle;
import android.support.v4.view.ViewPager;
View build.gradle
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.4.2'
}
}
View ManagedExecutor.java
package com.ogaclejapan;
import java.util.concurrent.Executor;
import java.util.concurrent.RejectedExecutionException;
import java.util.concurrent.TimeUnit;
/**
* 送信された Runnable タスクを実行するオブジェクトです。
* <p>id毎にタスクを管理しているため、同一idのタスクがまだ動作中の場合は実行をキャンセルしてくれます</p>
*/
View build.gradle
buildscript {
repositories {
mavenCentral()
maven {
url 'http://sardine.googlecode.com/svn/maven/'
}
}
dependencies {
classpath 'com.googlecode.sardine:sardine:314'
}