小编yos*_*i24的帖子

如何获得一个月的日子?

我想检索它是哪个月的哪一天.

比如今天是2011年8月29日.

我想做的就是得到29天或30天的天数.这个月的哪一天.

我该怎么做呢?

java android

46
推荐指数
3
解决办法
14万
查看次数

如何获得设备的屏幕尺寸?

我想得到一个Android屏幕的高度,如果屏幕在一定高度,我将如何去做这个?

android

33
推荐指数
2
解决办法
6万
查看次数

如何使用声音和振动通知?

启动通知时,如何让设备振动或发出声音.

我听说过FLAGS.但是我如何将它们用于声音和振动?

android notificationmanager

26
推荐指数
2
解决办法
4万
查看次数

如何设置点击监听器以进行通知?

通过AlarmManager启动服务时,我使用以下代码启动通知:

nm = (NotificationManager) this.getSystemService(Context.NOTIFICATION_SERVICE);
CharSequence from = "App";
CharSequence message = "Getting Latest Info...";
PendingIntent contentIntent = PendingIntent.getActivity(this, 0, new Intent(), 0);
Notification notif = new Notification(R.drawable.icon,
    "Getting Latest Info...", System.currentTimeMillis());
notif.setLatestEventInfo(this, from, message, contentIntent);
nm.notify(1, notif);
Run Code Online (Sandbox Code Playgroud)

如何设置此项目的意图,以便当用户点击它时,它会启动某个活动?

android notificationmanager

23
推荐指数
3
解决办法
8万
查看次数

如何在片段类中创建datePicker和timePicker对话框?

我想知道有没有办法在片段中创建一个datePicker?我正在创建一个常规活动可能,它给我语法错误.这样做的正确方法是什么?

android

17
推荐指数
4
解决办法
4万
查看次数

如何使用SharedPreferences保存URI或任何存储?

URI imageUri = null;

//Setting the Uri of aURL to imageUri.
try {
    imageUri = aURL.toURI();
} catch (URISyntaxException e1) {
    // TODO Auto-generated catch block
    e1.printStackTrace();
}
Run Code Online (Sandbox Code Playgroud)

我正在使用此代码将URL转换为URI.我怎样才能将imageUri保存到SharedPreferences,或者将其删除的内存不能删除onDestroy()?

我不想做SQLite数据库,因为当URL改变时URI会改变.我不想用掉未使用的URI的内存

android

6
推荐指数
2
解决办法
1万
查看次数

如何实现ALTER TABLE的示例

我已经多次问过这个问题而且还得到了一个完整的答案......如何实现ALTER TABLE语句以将列添加到数据库中.有人可以举个例子吗?

sqlite android

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

如何制作Android手机铃声?

我想通过代码制作一个Android手机铃声.例如,安装了一个应用程序,并且该应用程序收到一个应用程序侦听的调用.如果某个号码呼叫,则播放特定的铃声.我如何制作代码来制作Android手机铃声?

android

5
推荐指数
1
解决办法
7940
查看次数

如何将从url中检索到的图像存储在SQLite数据库中?

我正在从网址中检索图像.而不是缓存图像,是否有可能将它存储在SQLite数据库中?

                /** Simple Constructor saving the 'parent' context. */
                public ImageAdapter(Context c) { this.myContext = c; }





                /** Returns the amount of images we have defined. */
                public int getCount() { return this.myRemoteImages.length; }

                /* Use the array-Positions as unique IDs */
                public Object getItem(int position) { return position; }
                public long getItemId(int position) { return position; }

                /** Returns a new ImageView to
                * be displayed, depending on
                * the position passed. */
                public View getView(int position, View convertView, …
Run Code Online (Sandbox Code Playgroud)

android

4
推荐指数
3
解决办法
9279
查看次数

如何停止按回按钮返回活动中打开的每个片段?

我使用它来根据设备的屏幕大小启动一个新片段.

FragmentManager fragMgr = getSupportFragmentManager();
        releaseInfoFragment release = (releaseInfoFragment)fragMgr.findFragmentById(R.id.release);

            release = releaseInfoFragment.newInstance(url);
            FragmentTransaction xaction = fragMgr.beginTransaction();
            xaction.replace(R.id.release, release)
            .setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN)
            .addToBackStack(null)
            .commit();
    }
Run Code Online (Sandbox Code Playgroud)

问题是当用户按下后退按钮时,它会返回到在活动生命周期中打开的每个片段.我怎么能在不这样做的地方做到这一点?我只是希望它在第一次按下时删除片段,然后在第二次单击时返回到以下活动.

我该怎么做呢?

android fragment

4
推荐指数
1
解决办法
7532
查看次数

标签 统计

android ×10

notificationmanager ×2

fragment ×1

java ×1

sqlite ×1