小编Kha*_*ogo的帖子

如何在没有外部应用程序的情况下打开/显示文档(.pdf,.doc)?

我想创建一个程序,打开没有外部应用程序的文档.我需要这个,因为我想用手机方向滚动文件(Pitch and Roll).我在屏幕底部创建了一个按钮,当我按住按钮时,我也可以滚动文档.如果我松开按钮,我无法滚动它.因此,如果我使用外部应用程序打开文档,我的按钮会消失,而sensorManager也不会工作.

有人有任何想法来解决这个问题.或者有任何想法,如何滚动文档,在外部应用程序中打开,我的手机方向?

(对不起我的英语不好)

这是我的表现:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.orientationscrolling"
android:versionCode="1"
android:versionName="1.0" >

<uses-sdk
    android:minSdkVersion="8"
    android:targetSdkVersion="17" />
<uses-permission android:name="android.permission.INTERNET" />

<application
    android:allowBackup="true"
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/AppTheme" >
    <activity
        android:name="com.example.orientationscrolling.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>
</application>
</manifest>
Run Code Online (Sandbox Code Playgroud)

这是我的布局:

<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:orientation="vertical" >

<WebView
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/webView1"
    android:layout_width="match_parent"
    android:layout_height="match_parent" />

<LinearLayout
    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:gravity="bottom"
    android:orientation="vertical" >

<Button 
   android:id="@+id/mybutt"
   android:layout_width="wrap_content"
   android:layout_height="wrap_content"
   android:textSize="25sp"
   android:text="Scroll!!"
   android:layout_gravity="right"/>
</LinearLayout>
Run Code Online (Sandbox Code Playgroud)

这是我的代码:

protected void onCreate(Bundle savedInstanceState) {

    super.onCreate(savedInstanceState); …
Run Code Online (Sandbox Code Playgroud)

pdf android external

18
推荐指数
1
解决办法
8万
查看次数

标签 统计

android ×1

external ×1

pdf ×1