This file contains 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
<!-- 原本可能是這樣 --> | |
<activity | |
android:name=".MainActivity" | |
android:label="@string/app_name" > | |
<intent-filter> | |
<action android:name="android.intent.action.MAIN" /> | |
<category android:name="android.intent.category.LAUNCHER" /> | |
</intent-filter> | |
</activity> |
This file contains 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 DataAdapter extends BaseAdapter { | |
private Context mContext; | |
private List<Data> mDataList; | |
private LayoutInflater mInflater; | |
public AnnouncementAdapter(Context ctx, List<Data> dataList) { | |
mContext = ctx; | |
mDataList = dataList; | |
mInflater = (LayoutInflater) ctx.getSystemService(Context.LAYOUT_INFLATER_SERVICE); | |
} |
This file contains 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
<menu xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:app="http://schemas.android.com/apk/res-auto"> | |
<item android:id="@+id/menu_search" | |
android:icon="your icon" | |
android:title="your title" | |
android:orderInCategory="0" | |
app:actionViewClass="android.support.v7.widget.SearchView" | |
app:showAsAction="always" /> | |
</menu> |
This file contains 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
<!-- 取得連接Internet的權限 --> | |
<uses-permission android:name="android.permission.INTERNET" /> | |
<!-- 在 application 標籤中加入 EvernoteOAuth 的 Activity --> | |
<activity | |
android:name="com.evernote.client.android.EvernoteOAuthActivity" | |
android:configChanges="orientation|keyboardHidden" /> |
This file contains 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"?> | |
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | |
package="com.apptrunks.helloevernote" | |
android:versionCode="1" | |
android:versionName="1.0" > | |
<!-- 取得連接Internet的權限 --> | |
<uses-permission android:name="android.permission.INTERNET" /> | |
<uses-sdk |
This file contains 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
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:tools="http://schemas.android.com/tools" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
android:paddingBottom="@dimen/activity_vertical_margin" | |
android:paddingLeft="@dimen/activity_horizontal_margin" | |
android:paddingRight="@dimen/activity_horizontal_margin" | |
android:paddingTop="@dimen/activity_vertical_margin" | |
tools:context=".MainActivity" > |
This file contains 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
//定義三個 Evernote SDK 一定要用到的三個參數 | |
private static final String CONSUMER_KEY = "改成您的 CONSUMER_KEY"; | |
private static final String CONSUMER_SECRET = "改成您的 CONSUMER_SECRET"; | |
private static final EvernoteSession.EvernoteService EVERNOTE_SERVICE = EvernoteSession.EvernoteService.SANDBOX; | |
//宣告 EvernoteSession 物件 | |
protected EvernoteSession mEvernoteSession; | |
//宣告兩個要串接介面元素物件 | |
private Button mBtnLogin; | |
private TextView mTxtToken; |
This file contains 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 String doSomething(MyType type) { | |
String result; | |
switch(type) { | |
type1: | |
result = "1"; | |
break; | |
type2: | |
result = "2"; | |
break; |
This file contains 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 String doSomething(MyType type) { | |
switch(type) { | |
type1: | |
return "1"; | |
type2: | |
return "2"; | |
default: | |
return null; | |
} | |
} |
This file contains 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
package biz.mosil.sample.evernote.workshop; | |
import com.evernote.client.android.EvernoteSession; | |
import android.app.Activity; | |
import android.os.Bundle; | |
public class ParentActivity extends Activity { | |
private static final String CONSUMER_KEY = "your consumer key"; |
OlderNewer