Back to project page OneNoteAPISampleAndroid.
The source code is released under:
Apache License
If you think the Android project OneNoteAPISampleAndroid listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
//********************************************************* // Copyright (c) Microsoft Corporation // All rights reserved. ///* ww w. jav a2s . c o m*/ // 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 // // THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT // WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS // OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED // WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR // PURPOSE, MERCHANTABLITY OR NON-INFRINGEMENT. // // See the Apache Version 2.0 License for specific language // governing permissions and limitations under the License. //********************************************************* package com.example.onenoteservicecreatepageexample; import com.example.onenoteservicecreatepageexample.R; import android.app.Activity; import android.content.Intent; import android.os.Bundle; import android.support.v4.app.NavUtils; import android.text.Html; import android.text.method.LinkMovementMethod; import android.view.Menu; import android.view.MenuItem; import android.widget.TextView; public class ResultsActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_results); // Show the Up button in the action bar. setupActionBar(); //Get messages from the intent Intent intent = getIntent(); String clientUrl = intent.getStringExtra(Constants.CLIENT_URL).replaceAll( //This regular expression adds curly braces before and after the section identifier and page identifier values in the client URL "=([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})&", "={$1}&"); TextView clientLinkView = (TextView) findViewById(R.id.lbl_clientLink); clientLinkView.setText(Html.fromHtml("<a href = \'" + clientUrl + "\'>" + clientUrl + "</a>")); clientLinkView.setMovementMethod(LinkMovementMethod.getInstance()); //Set the messages ((TextView) findViewById(R.id.lbl_Response)).setText(intent.getStringExtra(Constants.RESPONSE)); ((TextView) findViewById(R.id.lbl_webLink)).setText(intent.getStringExtra(Constants.WEB_URL)); } /** * Set up the {@link android.app.ActionBar}. */ private void setupActionBar() { getActionBar().setDisplayHomeAsUpEnabled(true); } @Override public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bar if it is present. getMenuInflater().inflate(R.menu.results, menu); return true; } @Override public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case android.R.id.home: // This ID represents the Home or Up button. In the case of this // activity, the Up button is shown. Use NavUtils to allow users // to navigate up one level in the application structure. For // more details, see the Navigation pattern on Android Design: // // http://developer.android.com/design/patterns/navigation.html#up-vs-back // NavUtils.navigateUpFromSameTask(this); return true; } return super.onOptionsItemSelected(item); } }