Skip to content

Instantly share code, notes, and snippets.

View griajobag's full-sized avatar
🏠
Working from home

Putu Guna griajobag

🏠
Working from home
View GitHub Profile
package com.example.putuguna.viewpagerindicator;
import android.content.Context;
import android.support.v4.view.PagerAdapter;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.LinearLayout;
package com.example.putuguna.viewpagerindicator;
import android.support.v4.view.ViewPager;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;
import android.widget.LinearLayout;
public class MainActivity extends AppCompatActivity implements ViewPager.OnPageChangeListener{
package com.example.putuguna.viewpagerindicator;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
public class SecondActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
@griajobag
griajobag / SharedPreference
Created July 1, 2016 17:56
splash screen
SharedPreferences sharedPreferences = getSharedPreferences("myPref", Context.MODE_PRIVATE);
if(sharedPreferences.getBoolean("first", false)){
Intent intent = new Intent(this, SecondActivity.class);
startActivity(intent);
finish();
}else{
SharedPreferences.Editor edit = sharedPreferences.edit();
edit.putBoolean("first",true);
edit.commit();
}
@griajobag
griajobag / PositiveNegative.java
Last active July 2, 2016 07:32
negative positive
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package education;
import java.util.*;
/**
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package oop;
/**
*
* @author putuguna
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package oop;
/**
*
* @author putuguna
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package oop;
/**
*
* @author putuguna
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package b;
import oop.OrangTua;
/**
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package overload;
/**
*
* @author putuguna